ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Can I use series of variables, in one "IF" ? (https://www.excelbanter.com/excel-discussion-misc-queries/52687-can-i-use-series-variables-one-if.html)

nastech

Can I use series of variables, in one "IF" ?
 
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


Gary''s Student

Can I use series of variables, in one "IF" ?
 
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.
--
Gary's Student


"nastech" wrote:

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


nastech

Can I use series of variables, in one "IF" ?
 
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(A 1,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

"Gary''s Student" wrote:

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.
--
Gary's Student


"nastech" wrote:

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


Dana DeLouis

Can I use series of variables, in one "IF" ?
 
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. :)
--
Dana DeLouis
Win XP & Office 2003


"nastech" wrote in message
...
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




nastech

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

"Dana DeLouis" wrote:

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. :)
--
Dana DeLouis
Win XP & Office 2003


"nastech" wrote in message
...
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





Ragdyer

Can I use series of variables, in one "IF" ?
 
It's really *not* an array formula Dana.

CSE is not necessary.
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Dana DeLouis" wrote in message
...
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. :)
--
Dana DeLouis
Win XP & Office 2003


"nastech" wrote in message
...
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





Dana DeLouis

Can I use series of variables, in one "IF" ?
 
Oops! You're right. I've been using CSE. Thanks for the catch! :)

--
Dana DeLouis


"Ragdyer" wrote in message
...
It's really *not* an array formula Dana.

CSE is not necessary.
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Dana DeLouis" wrote in message
...
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. :)
--
Dana DeLouis
Win XP & Office 2003


"nastech" wrote in message
...
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








All times are GMT +1. The time now is 10:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com