How to filter out certain state

[Solved/Closed]
Report
-
 Sam -
Hello,



I want to be able to filter out certain states in column B. Column A contain all the states and I want the state: CA, NV, TX, MO, MS, and MI to display a certain word in column B for these states only. How do I get column B to display the word " Vacation" for the states listed above in excel?

Problem A: What is the formula for the above in excel?
Problem B: What is the formula for the above in excel macro if I choose to go this direction?

Thanks!

2 replies

Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
802
In the first cell in B column (where column is state name) type this formula

=IF(OR(A2="CA",A2="TX",A2="NV",A2="MO",A2="MS",A2="MI"),"VACATION","")

copy this down till the data is available

remember in certain version you cannot have more than 7 possiilities under OR.

in the case of macro study "select case"
It works!. Thank you so much!!!