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

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
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,223,911
Messages
6,175,331
Members
452,636
Latest member
laura12345

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