Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi. I am doing a simple IF statement with an OR in it.
If(OR(B2="A",B2="B",B2="C"), "X","Y") but I have many more of the OR criteria, so it takes a long time to type, lots of room for typos. Is there a more efficient way where I can say, basically if B2 equals anything in this list, then "X", otherwise "Y"? I tried a dozen variations but kept getting the "VALUE" error. Thanks! I do these a lot, so I'd like to speed it up... |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Say you one hundred possible valid values for the IF. Rather than make a
super-long formula; list them in a column, say column Z from Z1 thru Z100. And then: =IF(COUNTIF(Z1:Z100,B2)0,"X","Y") -- Gary''s Student - gsnu200830 "Chatnoir11" wrote: Hi. I am doing a simple IF statement with an OR in it. If(OR(B2="A",B2="B",B2="C"), "X","Y") but I have many more of the OR criteria, so it takes a long time to type, lots of room for typos. Is there a more efficient way where I can say, basically if B2 equals anything in this list, then "X", otherwise "Y"? I tried a dozen variations but kept getting the "VALUE" error. Thanks! I do these a lot, so I'd like to speed it up... |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
D'oh! So simple I never considered that! THANK YOU SO MUCH!!
"Gary''s Student" wrote: Say you one hundred possible valid values for the IF. Rather than make a super-long formula; list them in a column, say column Z from Z1 thru Z100. And then: =IF(COUNTIF(Z1:Z100,B2)0,"X","Y") -- Gary''s Student - gsnu200830 "Chatnoir11" wrote: Hi. I am doing a simple IF statement with an OR in it. If(OR(B2="A",B2="B",B2="C"), "X","Y") but I have many more of the OR criteria, so it takes a long time to type, lots of room for typos. Is there a more efficient way where I can say, basically if B2 equals anything in this list, then "X", otherwise "Y"? I tried a dozen variations but kept getting the "VALUE" error. Thanks! I do these a lot, so I'd like to speed it up... |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
=IF(OR(B2={"A","B","C"}),"X","Y")
Chatnoir11 wrote: Hi. I am doing a simple IF statement with an OR in it. If(OR(B2="A",B2="B",B2="C"), "X","Y") but I have many more of the OR criteria, so it takes a long time to type, lots of room for typos. Is there a more efficient way where I can say, basically if B2 equals anything in this list, then "X", otherwise "Y"? I tried a dozen variations but kept getting the "VALUE" error. Thanks! I do these a lot, so I'd like to speed it up... -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks-- this might be simpler for me.
"Dave Peterson" wrote: =IF(OR(B2={"A","B","C"}),"X","Y") Chatnoir11 wrote: Hi. I am doing a simple IF statement with an OR in it. If(OR(B2="A",B2="B",B2="C"), "X","Y") but I have many more of the OR criteria, so it takes a long time to type, lots of room for typos. Is there a more efficient way where I can say, basically if B2 equals anything in this list, then "X", otherwise "Y"? I tried a dozen variations but kept getting the "VALUE" error. Thanks! I do these a lot, so I'd like to speed it up... -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sum if statement with a left statement | Excel Discussion (Misc queries) | |||
embedding "ISERROR" function into an "IF" statement | Excel Worksheet Functions | |||
appending and IF statement to an existing IF statement | Excel Worksheet Functions | |||
If statement and Isblank statement | Excel Worksheet Functions | |||
Help please, IF statement/SUMIF statement | Excel Worksheet Functions |