# multiple if or statement

#### joebloggs

##### New Member
I'm looking to return the value of 1 or 2 or 3 in a cell IF a cell contains another specific number in a range

example
the result will be display in 1 cell (A5)

IF cell A4 = 2 or 5 or 8 or 11 then A5 = 1

IF cell A4 = 1 or 4 or 7 or 10 then A5 = 2

IF cell A4 = 3 or 6 or 9 or 12 then A5 = 3

Any help will be appreciated.

### Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

#### peterhinton

##### Active Member
=IF(OR(A4=2,A4=5,A4=8,A4=11),1,IF(OR(A4=1,A4=4,A4=7,A4=10),2,IF(OR(A4=3,A4=6,A4=9,A4=12),3,"N/A")))

"N/A" is used if A4 does not equal any of the numbers,

#### joebloggs

##### New Member
many thanks Peter

#### AlanY

##### Well-known Member
an alternative

=CHOOSE(MOD(A4,3)+1,3,2,1)

#### joebloggs

##### New Member
thanks Alan, thats awesome

you're welcome

Replies
3
Views
483
Replies
8
Views
298
Replies
12
Views
593
Replies
5
Views
548
Replies
16
Views
489

1,191,177
Messages
5,985,132
Members
439,941
Latest member
robertv13

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