Can I use series of variables, in one "IF" ?

N

nastech

Have something like:
IF(OR(A1="aa",A1="ab",A1="ac",A1="ad"),"")

Can I do something like:
IF(A1="aa";"ab";"ac";"ad"),"")

Running out of space.. thanks -nastech
 
G

Gary''s Student

If you have a large list of items to which A1 is being compared, one approach
is to put the list in a column and use the MATCH() function. If MATCH can
find a row then you have TRUE.
 
N

nastech

Hi, not sure, maybe not.. Learning / getting alot more stuff on excel, but
have many variables possible in one cell; For match do I have to make a list
of possible variables, or is there a different answer for one cell.

Already (/actually) using RIGHT Functions, is just expanding it out more
than my example, including stuff like:
....(AND(RIGHT(A1,1)="a",RIGHT(A1,2)<>"ad",RIGHT(A1,2)<>"ae",RIGHT(A1,2)<>"af")...
... ,"",IF(AND(OR(RIGHT(A1,2)="aa",...,OR(RIGHT(B1,2)="aa"... comparing 2
cells for similar traits to get true to happen.

Need is to reduce, not sure what to use; possible answers are not
sequential like shown, aa ab etc. but will take example for that to, else do
I need to make a set of all possible answers? / how? Thank you much in
advance. -nastech
 
D

Dana DeLouis

Can I do something like:
IF(A1="aa";"ab";"ac";"ad"),"")

Hi. Here you go. It's an array formula, so enter the formula with
Ctrl+Shift+Enter.

=IF(OR(A1={"aa","ab","ac","ad"}),"Yes","No")

HTH. :>)
 
N

nastech

Thankyou!!

Dana DeLouis said:
Hi. Here you go. It's an array formula, so enter the formula with
Ctrl+Shift+Enter.

=IF(OR(A1={"aa","ab","ac","ad"}),"Yes","No")

HTH. :>)
 
Top