Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Validation List Question wx4usa Excel Discussion (Misc queries) 1 October 13th 07 04:36 AM
Data Validation-List..Question? maperalia Excel Discussion (Misc queries) 4 July 12th 07 06:37 PM
Copy Formula with Linked Cells - Validation Question Lori-Wheaten Links and Linking in Excel 0 July 21st 06 03:24 PM
HELP: Data > Validation ---List ----Formula amit Excel Worksheet Functions 3 April 15th 05 01:38 PM
Data Validation list selection question Bob Wall Excel Worksheet Functions 2 December 4th 04 04:51 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"