# Listing multiple criteria in IF statement without nesting

#### Nanaia

##### Board Regular
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

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

##### Well-known Member
Hi Nanaia,

Try
`=IF(OR(E9=1,E9=2,E9=3,E9=6,E9=9,E9=12),A9-0.103,FALSE)`

#### Fluff

##### MrExcel MVP, Moderator
You need to use OR like
Excel Formula:
``=IF(OR(E9={1,2,3,6,9,12}),A9-0.103,FALSE)``

#### Nanaia

##### Board Regular
Using OR made it work the way I needed it to work. Thank you!

#### Fluff

##### MrExcel MVP, Moderator
Glad we could help & thanks for the feedback.

Replies
1
Views
58
Replies
1
Views
77
Replies
10
Views
715
Replies
7
Views
86
Replies
15
Views
487

1,128,107
Messages
5,628,724
Members
416,333
Latest member
Time2Learn

### 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.

### Which adblocker are you using?

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

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