Nested if then

Solved/Closed
chiflado Posts 5 Registration date Sunday November 9, 2014 Status Member Last seen November 12, 2014 - Nov 9, 2014 at 04:54 PM
vcoolio Posts 1411 Registration date Thursday July 24, 2014 Status Moderator Last seen September 6, 2024 - Nov 12, 2014 at 05:10 PM
Hello,

I would like to have the contents of b1 displayed in m2 if t2=1, the contents of b2 displayed in m2 if t2=2, the contents of c1 displayed in m2 if t2=3 etc all the way up to if t2=6.

Thanks.
Related:

5 responses

vcoolio Posts 1411 Registration date Thursday July 24, 2014 Status Moderator Last seen September 6, 2024 262
Nov 9, 2014 at 09:24 PM

Is the following formula possibly what you need? Place it in M2:-

=IF(T2=1,B1,IF(T2=2,B2,IF(T2=3,C1,IF(T2=4,C2,IF(T2=5,D1,IF(T2=6,D2))))))

I'm assuming that you require the first two values in the first two rows of Columns "B", "C" and "D" placed in M2 once your values in T2 are entered.

Cheers,
vcoolio.
chiflado Posts 5 Registration date Sunday November 9, 2014 Status Member Last seen November 12, 2014
Nov 10, 2014 at 01:52 PM
Super! This is exactly what I'm looking for. I couldn't get the syntax right so I'm very thankful that you know what your doing! Thank you, thank you, thank you.
chiflado Posts 5 Registration date Sunday November 9, 2014 Status Member Last seen November 12, 2014
Nov 10, 2014 at 01:55 PM
Is there a way to do more than 7 nested if then statements?
chiflado Posts 5 Registration date Sunday November 9, 2014 Status Member Last seen November 12, 2014
Nov 10, 2014 at 01:59 PM
And... Is there a way to have M2 blank if T2 is blank? Right now it reads "FALSE" if nothing is in there.

Didn't find the answer you are looking for?

vcoolio Posts 1411 Registration date Thursday July 24, 2014 Status Moderator Last seen September 6, 2024 262
Nov 10, 2014 at 07:54 PM

I believe that up to 64 IF functions can be nested in an If formula. You can probably pick up on the pattern in the formula above, so give it a try and see how it works.

To remove "False" from the cell, try this slightly amended formula:-

=IF(T2=1,B1,IF(T2=2,B2,IF(T2=3,C1,IF(T2=4,C2,IF(T2=5,D1,IF(T2=6,D2,""))))))

Regards,
vcoolio.
chiflado Posts 5 Registration date Sunday November 9, 2014 Status Member Last seen November 12, 2014
Nov 12, 2014 at 12:16 PM
Outstanding! Thank you very much. You've saved me a TON of work.
vcoolio Posts 1411 Registration date Thursday July 24, 2014 Status Moderator Last seen September 6, 2024 262
Nov 12, 2014 at 05:10 PM
You're welcome Chiflado. Glad I could help.

Cheers,
vcoolio.