Array lookup

Rolly_Sefu

Board Regular
Joined
Oct 25, 2013
Messages
149
Hello.

I have the following array: {2;FALSE;5;FALSE;FALSE;6} - row numbers

Is it possible to get the values from the range A1:A6 based on the array above and get this result => {A2;FALSE;A5;FALSE;FALSE;A6} ?

I can not use SMALL function since I need the values from A1:A6 to remain in an array.

Help please.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Code:
=if({2,false,5,false,false,6},index(a1:a6,n(if(1,{2,false,5,false,false,6}))))
 
Upvote 0
works perfectly.

1 question if I evaluate the row_num from index I get {2;0;5;0;0;6}, how come index can get it right with the N function but without it will only return 2.

I tried to evaluate the index after I evaluated the row_num and it also result only the 2.
 
Upvote 0

Forum statistics

Threads
1,215,003
Messages
6,122,655
Members
449,091
Latest member
peppernaut

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