IF statement with multiple values

srwalesh

New Member
Joined
May 4, 2016
Messages
7
I am looking for help on an excel formula in which i would like to do two things. I have two columns, one with a five digit number (column A), then column B will have the formula. If the value in column A is either 20800, 24900, 59000 or 60000, i would like it to return a 'INVALID' value. Then, for all other values to reference another sheet (sheet1) to pull a state name. My guess is to use a vlookup for the second portion, but currently i have 5 nested 'IF' statements and I am hoping there is a more precise formula to use.

Can anyone help?

thanks!
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
This formula assumes that your data has headers.

=IF(OR(A2="20800",A2="24900",A2="59000",A2="60000"),"INVALID","VALID")

Now, the "VALID" part of the formula can be changed to an index match/vlookup.
 
Upvote 0
maybe...

=IF(OR(A1={20800;24900;59000;60000}),"invalid", VLOOKUP(A1,data,column,0))
 
Upvote 0

Forum statistics

Threads
1,215,051
Messages
6,122,872
Members
449,097
Latest member
dbomb1414

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