Repeating Cell References in a formula

G

greasybob

I'm a relative newby so this may be an easy question.

I am trying to use the OR function to reference several occurances suc
as:

=if(or(a1="KY",a1="NY",a1="WY",a1="TX",a1="VT"),"Valid State","Invali
State"))


I need to way down with this formula since the various states will sho
up many times. Also I've shown only 5 states in the formula bu
actually have many more.

My question is: Is there a shortcut to typing "a1=...." over an
over?

Hope this makes sense and thanks in advance if you can help
 
F

Frank Kabel

Hi
if you put your valid states in a range (lest say X1:X20) use the
following formula
=IF(ISNUMBER(MATCH(A1,X1:X20,0)),"Valid State","Invalid State"))
 
Top