IF array not working (SOLVED)

phantom1975

MrExcel MVP
Joined
Jun 3, 2002
Messages
3,962
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

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,209
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
Joined
Jun 3, 2002
Messages
3,962
=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.
 

phantom1975

MrExcel MVP
Joined
Jun 3, 2002
Messages
3,962
RIGHT ON! That was perfect. It is WAY better than doing a nested IF statement!
 

Forum statistics

Threads
1,144,282
Messages
5,723,474
Members
422,499
Latest member
think say

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
Top