Working with Criteria and formulas

B.Kellough

Board Regular
Joined
Aug 1, 2009
Messages
180
=IF(C2=1,"IAP",IF(D2=1,"PIP",IF(E2=1,"STEP","")))

Does anyone know if there is a way to change the formula above; and make it set a priority as to which result is displayed. Meaning=

If C2=1 and D2=1, the formula would aways bring back "PIP" showing that "D2" has a higher priority. With the way this works now it finds the first "1" and brings back the results for that and doesn't look for the second criteria.

Thanks for any help.
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Change the order of your testing conditions in your IF statement; the IF statement will always evaluate what it encouters first, so change it to:
Code:
=IF(D2=1,"PIP",IF(C2=1,"EAP",IF(E2=1,"STEP","")))
 
Upvote 0
Try:

=IF(D2=1,"PIP",IF(C2=1,"IAP",IF(E2=1,"STEP","")))
 
Upvote 0
Thank you!

That works; goes to show sometimes we get stuck on something and forget to look at it from enough angles!

Thanks again
 
Upvote 0
=IF(C2=1,"IAP",IF(D2=1,"PIP",IF(E2=1,"STEP","")))

Does anyone know if there is a way to change the formula above; and make it set a priority as to which result is displayed. Meaning=

If C2=1 and D2=1, the formula would aways bring back "PIP" showing that "D2" has a higher priority. With the way this works now it finds the first "1" and brings back the results for that and doesn't look for the second criteria.

Thanks for any help.
The priority is based on the sequence in which you have the conditional tests.

Maybe this is what you want:

=IF(OR(AND(C2=1,D2=1),D2=1),"PIP",IF(C2=1,"IAP",IF(E2=1,"STEP","")))
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,728
Members
452,939
Latest member
WCrawford

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