How to combine all these IF's into one formula

KcrazyCowboy

New Member
Joined
Jun 13, 2016
Messages
33
Office Version
  1. 2010
Platform
  1. Windows
  2. MacOS
  3. Mobile
Hi guys and gals,

Needing some help if figuring out how to create one formula that can provide what i need. Which is to have several "IF" statements returned with the right answer. I would like to find a way to create the formula that looks up each word and returns into with a numerical value.

=IF(B2="FIRM",0,"")
=IF(B2="FORECAST",1,"")
=IF(B2="ALLOCATION",2,"")
=IF(B2="DEFICIT",3,"")
=IF(B2="SAFETY",4,"")
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Try

Excel Formula:
=IF(B2="FIRM",0,IF(B2="FORECAST",1,IF(B2="ALLOCATION",2,IF(B2="DEFICIT",3,IF(B2="SAFETY",4,"")))))
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Another option
Excel Formula:
=IFNA(MATCH(B2,{"FIRM","FORECAST","ALLOCATION","DEFICIT","SAFETY"},0)-1,"")
 
Upvote 0

Forum statistics

Threads
1,216,105
Messages
6,128,859
Members
449,472
Latest member
ebc9

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