Nested IF statements within a range

jthrum

New Member
Joined
Jul 24, 2018
Messages
9
Hi All,

I'm looking to create an if statement that returns a specific phrase if a cell matches cells within another range exactly.

So far this is what I've got.

=IF(C2='Model List'!G2:G62,"H15",(IF(C2='Model List'!$E$2:$E$17,"H17",(IF(C2='Model List'!$C$2:$C$71,"H20",(IF(C2='Model List'!$A$2:$A$200,"H25","")))))))

the formula works for models within the first if statement, however, anything after that automatically skips to the final 'if false' in the last if statement, being "".

i'm not sure what's wrong with my formula. If anyone could help me out i'd really appreciate it!

Thanks Guys!
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
MAybe this
Code:
=IF(C2='Model List'!G2:G62,H15,IF(C2='Model List'!$E$2:$E$17,H17,IF(C2='Model List'!$C$2:$C$71,H20,IF(C2='Model List'!$A$2:$A$200,H25,""))))
 
Upvote 0
MAybe this
Code:
=IF(C2='Model List'!G2:G62,H15,IF(C2='Model List'!$E$2:$E$17,H17,IF(C2='Model List'!$C$2:$C$71,H20,IF(C2='Model List'!$A$2:$A$200,H25,""))))


Sorry, the "H15","H17","H20","H25" are statements, not cell references.
 
Upvote 0
Okay, so simply put quotes around them

Code:
=IF(C2='Model List'!G2:G62,"H15",IF(C2='Model List'!$E$2:$E$17,"H17",IF(C2='Model List'!$C$2:$C$71,"H20",IF(C2='Model List'!$A$2:$A$200,"H25",""))))
 
Upvote 0
Okay, so simply put quotes around them

Code:
=IF(C2='Model List'!G2:G62,"H15",IF(C2='Model List'!$E$2:$E$17,"H17",IF(C2='Model List'!$C$2:$C$71,"H20",IF(C2='Model List'!$A$2:$A$200,"H25",""))))


Yeah, that's what I had in the original formula. However, if I try to use the formula in the proceeding cells, the formula doesn't return the correct statement, it just skips to the final "if false" which turns up "". The first cell I created the formula in registers all nested if statements. But I need all of the cells after that, in the same column, to act in the same way.
 
Upvote 0
Yeah, Sorry the non cell references threw me for a loop

Code:
=IF(COUNTIF('Model List'!G2:G62,C2)>0,"H15",IF(COUNTIF('Model List'!$E$2:$E$17,C2)>0,"H17",IF(COUNTIF('Model List'!$C$2:$C$71,C2)>0,"H20",IF(COUNTIF('Model List'!$A$2:$A$200,C2)>0,"H25",""))))
 
Upvote 0
Yeah, Sorry the non cell references threw me for a loop

Code:
=IF(COUNTIF('Model List'!G2:G62,C2)>0,"H15",IF(COUNTIF('Model List'!$E$2:$E$17,C2)>0,"H17",IF(COUNTIF('Model List'!$C$2:$C$71,C2)>0,"H20",IF(COUNTIF('Model List'!$A$2:$A$200,C2)>0,"H25",""))))

That worked like a charm, it's perfect! Thanks so much for your help!
 
Upvote 0

Forum statistics

Threads
1,223,719
Messages
6,174,087
Members
452,542
Latest member
Bricklin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top