Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Validation List/Formula Question
My goal seems to be fairly basic, but I have not been able to figure out an
easy formula. I would appreciate your thoughts/suggestions. Lets say I have a validation list of the 50 US States in cells A1. In B1 I want an output based on the state selected in A1. Lets say if A1 = NY or NJ or MA or FL the output is 1, for all other states the output is 0. I know I can write a formula such as =if(a1="NJ",1,if(a1="NY",1,if(a1="MA",1,if(a1="FL" ,1,0)))). My question is, can I use some sort of "OR" statement in place of all the IFs? I need to avoid all of the IFs because this is actually the lead question in a series of nested if/then questions in a much longer formula. Thanks in advance for any suggestions. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Validation List/Formula Question
I just figured out the magic of the "OR" statement. No replies needed.
Thanks. "JWNJ" wrote: My goal seems to be fairly basic, but I have not been able to figure out an easy formula. I would appreciate your thoughts/suggestions. Lets say I have a validation list of the 50 US States in cells A1. In B1 I want an output based on the state selected in A1. Lets say if A1 = NY or NJ or MA or FL the output is 1, for all other states the output is 0. I know I can write a formula such as =if(a1="NJ",1,if(a1="NY",1,if(a1="MA",1,if(a1="FL" ,1,0)))). My question is, can I use some sort of "OR" statement in place of all the IFs? I need to avoid all of the IFs because this is actually the lead question in a series of nested if/then questions in a much longer formula. Thanks in advance for any suggestions. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Validation List/Formula Question
One way:
=IF(OR(A1={"NY","NJ","MA","FL"}),1,0) -- Biff Microsoft Excel MVP "JWNJ" wrote in message ... My goal seems to be fairly basic, but I have not been able to figure out an easy formula. I would appreciate your thoughts/suggestions. Lets say I have a validation list of the 50 US States in cells A1. In B1 I want an output based on the state selected in A1. Lets say if A1 = NY or NJ or MA or FL the output is 1, for all other states the output is 0. I know I can write a formula such as =if(a1="NJ",1,if(a1="NY",1,if(a1="MA",1,if(a1="FL" ,1,0)))). My question is, can I use some sort of "OR" statement in place of all the IFs? I need to avoid all of the IFs because this is actually the lead question in a series of nested if/then questions in a much longer formula. Thanks in advance for any suggestions. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Data Validation List Question | Excel Discussion (Misc queries) | |||
Data Validation-List..Question? | Excel Discussion (Misc queries) | |||
Copy Formula with Linked Cells - Validation Question | Links and Linking in Excel | |||
HELP: Data > Validation ---List ----Formula | Excel Worksheet Functions | |||
Data Validation list selection question | Excel Worksheet Functions |