How to filter out certain state

Solved/Closed
Knight - Nov 13, 2010 at 01:00 PM
 Sam - Nov 14, 2010 at 12:06 PM
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 responses

venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Nov 13, 2010 at 09:30 PM
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!!!