Nested IF with text and numbers

NICKRENN

New Member
Joined
Sep 6, 2017
Messages
22
Hi

I'm having an issue with a nested IF formula. This is the formula i'm trying to use

=IF(BI2=over_600,"0",IF(BI2=450_600,"1",IF(BI2=301_450,"2",IF(BI2=151_300,"3",IF(BI2=51_150,"4",IF(BI2=0_50,"5","0"))))))

There are 7 variables and their corresponding scores(): Blank Cells (0), over_600 (0), 450_600 (1), 301_450 (2), 151_300 (3), 51_150 (4), 0_50 (5).

Currently the column is set to General, if i change it to Number i have the same issue that Excel just gives me the error message - your formula is wrong.

The file is converted from a CSV data collection tool.

Thanks

nick
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
try quoted the over_600 etc to "over_600" etc
 
Last edited:
Upvote 0
Thank you! - knew there was something i was forgetting.

using "over_600" is needed when things are not exclusively numbers correct?

Thanks

nick
 
Upvote 0
Hi, you should also unquote the numbers "0","1", etc should be 0,1 else they will be returned as text and not numbers.

Code:
=IF(BI2="over_600",0,IF(BI2="450_600",1,IF(BI2="301_450",2,IF(BI2="151_300",3,IF(BI2="51_150",4,IF(BI2="0_50",5,0))))))

And an alternative.
Code:
=IFNA(MATCH(BI2,{"over_600","450_600","301_450","151_300","51_150","0_50"},0)-1,0)
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,206
Members
452,618
Latest member
Tam84

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