Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to have an "if statement" between 2 drop down lists?

Status
Not open for further replies.

jimnewguy

Technical User
Jul 3, 2004
5
US
Is it possible to have an "if statement" between 2 drop down lists?

Example:

If cell A2 = YES
Look at list B
Else A2 = NO
Look at list C
 
Certainly. Although the "A2 = NO" is moot. If A2 is boolean, then it is yes, or no. It it is not yes (the else) then it has to be no.

Gerry
 
Is this Excel? Do you want this in an in-cell dropdown as per Data/Validation?


Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 
Couple of examples that may help. If you give us more specific info then we can tailor our responses to meet your specific needs...

=IF(A2="YES",SUM(B1:B100),SUM(C1:C100))

=IF(A2="YES",MAX(B1:B100),MAX(C1:C100))

=IF(A2="YES",VLOOKUP(A3,B1:C100,2,0),VLOOKUP(A3,E1:F100,2,0))

All these assume that there is only a Yes/No answer. If more than this is possible then they would need to be changed like this:-

=IF(A2="YES",SUM(B1:B100),IF(A2="NO",SUM(C1:C100),"Other"))

Regards
Ken............



----------------------------------------------------------------------------
[peace]It's easier to beg forgiveness than ask permission[2thumbsup]

----------------------------------------------------------------------------
 
Not sure if I understand what you want but:

Set a Validation in Say A2 that uses a list having:

Model 1
Model 2
Model 3

Then have a list named Model 1 that holds parts for model 1

ie. Brake Pad
Starter
Disc

and likewise for the other models

then in say cell d2 set validation source as =INDIRECT(A2)

This will then set the choices in D2 conditional on the choice made in a2

You can then cascade this down to further levels if you want

Regards

Keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top