Multiple IF Statements

  • Thread starter Thread starter Chris
  • Start date Start date
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
 
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
 
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
 
Back
Top