Listing multiple criteria in IF statement without nesting

Nanaia

Active Member
Joined
Jan 11, 2018
Messages
304
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I was shown once that there's a way to write an IF statement and list multiple criteria without having to write out multiple statements nested together. For example, IF cell E9 contains the numbers 1, 2, 3, 6, 9, or 12 then A9-0.103, if E9 doesn't contain those numbers then I'll continue with my nested statements. [ =IF(E9={1,2,3,6,9,12},A9-0.103,FALSE) ]. I thought you put { } around the several numbers you want the IF to check but it doesn't work. I get a #SPILL! error which tells me I'm doing it wrong. How do I do it correctly?
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Hi Nanaia,

Try
=IF(OR(E9=1,E9=2,E9=3,E9=6,E9=9,E9=12),A9-0.103,FALSE)
 
Upvote 0
You need to use OR like
Excel Formula:
=IF(OR(E9={1,2,3,6,9,12}),A9-0.103,FALSE)
 
Upvote 0
Solution
Using OR made it work the way I needed it to work. Thank you!
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,797
Messages
6,121,629
Members
449,041
Latest member
Postman24

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