Prioritising nested IF statements

rothexcel

New Member
Joined
Oct 17, 2017
Messages
4
I have many items which need to be classified according to either their status, range or description, depending on what each one is. The status, range and description of each of my products appear in different columns.
If the product has a "Bargain" status then it should be classified as "Bargain" and nothing else.
If the product does not have a "Bargain" status then other conditions need to be checked - If the description contains "Crossover" then it must be classified as "Crossover".
If the product does not have a "Bargain" status, and its description doesn't contain "Crossover" then it must be classified as whatever is shown in the Range column.
I have a formula which was working until I added an IF(ISNUMBER(SEARCH) formula. Now it is prioritising "Crossover" over "Bargain" and "Bargain" must have the first priority, "Crossover" the second.

Here is some of my data for reference:
[TABLE="width: 739"]
<tbody>[TR]
[TD]DESC[/TD]
[TD]RANGE[/TD]
[TD]STATUS[/TD]
[TD][/TD]
[TD]CLASSIFICATION S/BE - FORMULA TO KICK OUT[/TD]
[/TR]
[TR]
[TD]CROSSOVER COTTON N SINGLE[/TD]
[TD]CLASSICS[/TD]
[TD]BARGAIN[/TD]
[TD][/TD]
[TD]BARGAIN[/TD]
[/TR]
[TR]
[TD]BODY MAKE UP[/TD]
[TD]EVERYDAY[/TD]
[TD]REGULAR[/TD]
[TD][/TD]
[TD]FASHION[/TD]
[/TR]
[TR]
[TD]CROSSOVER COTTON N VALUE-PACK[/TD]
[TD]CLASSICS[/TD]
[TD]REGULAR[/TD]
[TD][/TD]
[TD]CROSSOVER[/TD]
[/TR]
[TR]
[TD]CROSSOVER COTTON N SINGLE[/TD]
[TD]CLASSICS[/TD]
[TD]BARGAIN[/TD]
[TD][/TD]
[TD]BARGAIN[/TD]
[/TR]
[TR]
[TD]SOFT SHAPER W[/TD]
[TD]BEAUTYFULL[/TD]
[TD]REGULAR[/TD]
[TD][/TD]
[TD]BEAUTY-FULL[/TD]
[/TR]
[TR]
[TD]TRI-ACTION MINIMIZER W[/TD]
[TD]TRI-ACTION[/TD]
[TD]REGULAR[/TD]
[TD][/TD]
[TD]TRI-ACTION[/TD]
[/TR]
</tbody>[/TABLE]


This is my current formula, but as I said the "Crossover" is being prioritised when in fact "Bargain" should be:

=IF(C3="BARGAIN","BARGAIN",IF(ISNUMBER(SEARCH("crossover",A3)),"CROSSOVER",IF(B3="EVERYDAY","FASHION",IF(B3="BASIC FIT","BEAUTY FULL",B3))))
 
Welcome to the forum.

That formula will not prioritise "crossover" over "Bargain". If C3 is BARGAIN, it will return BARGAIN and then exit. If you are seeing something else, then C2 doesn't contain BARGAIN - perhaps it has a leading/trailing space?
 
Upvote 0

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