# IF array not working (SOLVED)

#### phantom1975

##### MrExcel MVP
I have the following and it only works for the first condition:

=IF(A1={1,2,3,4,5},{11,22,33,44,55},0)

_________________
The only dumb question is the one that isn't asked. Pass on what you have learned.
This message was edited by phantom1975 on 2002-11-06 18:57

### Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

#### Mark W.

##### MrExcel MVP
Huh? What are you trying to accomplish?

##### MrExcel MVP
On 2002-11-06 18:45, phantom1975 wrote:
I have the following and it only works for the first condition:

=IF(A1={1,2,3,4,5},{11,22,33,44,55},0)

Are you trying to return {11,22,33,44,55} as result, if A1 is equal to one of the values in {1,2,3,4,5} ?

#### phantom1975

##### MrExcel MVP
=IF(A1={1,2,3,4,5},{11,22,33,44,55},0)

If A1 = 1, then B1 would equal 11
If A1 = 2, then B1 would equal 22
If A1 = 3, then B1 would equal 33
If A1 = 4, then B1 would equal 44
If A1 = 5, then B1 would equal 55

This is just an example! I know that I could just put =A1*11 in B1. These are just bogus numbers to illustrate what I am trying to do.

#### Mark W.

##### MrExcel MVP
=IF(OR(A1={1,2,3,4,5}),INDEX({11,22,33,44,55},,A1),0)

#### phantom1975

##### MrExcel MVP
RIGHT ON! That was perfect. It is WAY better than doing a nested IF statement!

Replies
42
Views
1K
Replies
4
Views
252
Replies
12
Views
207
Replies
0
Views
81
Replies
10
Views
502

1,147,748
Messages
5,742,976
Members
423,769
Latest member
LongToast

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