Multiple IF Statements

C

Chris

Hello,

I'm trying to write an IF statement that has 3 possible outcomes. I have
written each statement on their own and they all work, but I can't link them
together. What I would like to is:

IF cell E42 = "3 Months"
=IF(E42="3 Month", VLOOKUP(A45,Data!$A$2:$E$13,3,FALSE))

Else if cell E42 = "12 Months"
=IF(E42="12 Month", VLOOKUP(A45,Data!$A$2:$E$13,4,FALSE))

Else if cell E42 = "24 Months"
=IF(E42="24 Month", VLOOKUP(A45,Data!$A$2:$E$13,5,FALSE))

Any help would be great!

Thanks
 
R

Ron Rosenfeld

Hello,

I'm trying to write an IF statement that has 3 possible outcomes. I have
written each statement on their own and they all work, but I can't link them
together. What I would like to is:

IF cell E42 = "3 Months"
=IF(E42="3 Month", VLOOKUP(A45,Data!$A$2:$E$13,3,FALSE))

Else if cell E42 = "12 Months"
=IF(E42="12 Month", VLOOKUP(A45,Data!$A$2:$E$13,4,FALSE))

Else if cell E42 = "24 Months"
=IF(E42="24 Month", VLOOKUP(A45,Data!$A$2:$E$13,5,FALSE))

Any help would be great!

Thanks


You could just nest your IF statements, putting each subsequent one in the
"value if false" section of the preceding:

=IF(E42="3 Month", VLOOKUP(A45,Data!$A$2:$E$13,3,FALSE),
IF(E42="12 Month", VLOOKUP(A45,Data!$A$2:$E$13,4,FALSE),
IF(E42="24 Month", VLOOKUP(A45,Data!$A$2:$E$13,5,FALSE))))


Given your structure, the following might work also:

=VLOOKUP(A45,Data!$A$2:$E$13,
MATCH(E42,{"3 Months","12 Months","24 Months"},0)+2,FALSE)

In both formulas, (and in your original), you would need to decide how you want
to handle the returns should there be no matches, or if E42 does not contain
one of your selected items.
--ron
 
D

DILipandey

Hi Chris,
Try following:-

=IF(E42="3 months",VLOOKUP(A45,Data!$A$2:$E$13,3,FALSE),IF(E42="12
months",VLOOKUP(A45,Data!$A$2:$E$13,4,FALSE),VLOOKUP(A45,Data!$A$2:$E$13,5,FALSE)))
--
Click on Yes, if it is useful.

Thanks & Best Regards,
Dilip Kumar Pandey
MBA, BCA, B.Com(Hons.)
(e-mail address removed)
(e-mail address removed)
New Delhi, India
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top