Lookup brain freeze!!

Akashwani

Well-known Member
Joined
Mar 14, 2009
Messages
2,911
Hi,

I have the following situation....

Excel Workbook
ABCDEFGHIJKLMN
1RedData1BlueData2GreenData2PinkData3YellowData4LookupResults
2Red1vBlue1WGreen1xPink1YYellow1zBlueBlue1
3Red2vBlue2WGreen2xPink2YYellow2zBlue2
4Red3vBlue3WGreen3xPink3YYellow3zBlue3
5Red4vBlue4WGreen4xPink4YYellow4zBlue4
6Red5vBlue5WGreen5xPink5YYellow5zBlue5
7Red6vBlue6WGreen6xPink6YYellow6zBlue6
8Red7vBlue7WGreen7xYellow7zBlue7
9Blue8WGreen8xYellow8zBlue8
10Blue9WYellow9zBlue9
11Blue10WBlue10
12
Sheet1


Which formula do I require in M2 (copied down).

I'm sure I have had a similar situation in the past, but I cannot find any reference to it in my "sample workbooks"!!

Thanks

Ak
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Isn't something missing? What is supposed to select the row?
 
Upvote 0
just make sure I understand

you type a colour in L2
and then you want to lookup the colour across the range
A1:J1
and find the same word (colour) in the header and than in the column copy all the values under that heading
 
Upvote 0
Hi,

The Lookup value is the column header Blue (L2) and the outcome are the cells below Blue (M2:M11 in the example above)

** Yes etaf**

***Additional example***

Excel Workbook
ABCDEFGHIJKLMN
1RedData1BlueData2GreenData2PinkData3YellowData4LookupResults
2Red1vBlue1WGreen1xPink1YYellow1zPinkPink1
3Red2vBlue2WGreen2xPink2YYellow2zPink2
4Red3vBlue3WGreen3xPink3YYellow3zPink3
5Red4vBlue4WGreen4xPink4YYellow4zPink4
6Red5vBlue5WGreen5xPink5YYellow5zPink5
7Red6vBlue6WGreen6xPink6YYellow6zPink6
8Red7vBlue7WGreen7xYellow7z
9Blue8WGreen8xYellow8z
10Blue9WYellow9z
11Blue10W
12
Sheet1


Ak
 
Last edited:
Upvote 0
Post was truncated at right ...

Select M2:M11,

=INDEX($A$2:$J$11, 0, MATCH(L2, $A$1:$J$1, 0))
 
Upvote 0
Hi,

Perhaps:

Code:
=LOOKUP(
    REPT("z", 255),
    CHOOSE(
      {1,2},
      "",
      INDEX(
        A$2:J$11,
        ROWS(M$1:M1),
        MATCH(L$2, A$1:J$1, 0))))
 
Upvote 0
Hi,

Thanks all for your time and replies.

I'm going with Shg's formula, partly becasue I almost had it myself, doh!!

=INDEX($A$1:$J$1,MATCH($L$2,$A$2:$J$11,0))

Thanks again folks, greatly appreciated as always.

Ak
 
Upvote 0
M2, control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IFERROR(INDEX($A$2:$J$11,
  SMALL(IF(1-(INDEX($A$2:$J$11,0,MATCH($L$2,$A$1:$J$1,0))=""),
  ROW($A$2:$J$11)-ROW($A$2)+1),ROWS($M$2:M2)),
  MATCH($L$2,$A$1:$J$1,0)),"")
 
Upvote 0
Hi,

Thanks all for your time and replies.

I'm going with Shg's formula, partly becasue I almost had it myself, doh!!

=INDEX($A$1:$J$1,MATCH($L$2,$A$2:$J$11,0))

Thanks again folks, greatly appreciated as always.

Ak
I don't think your version will work based on what you described - unless its just a typo as shg's original array formula in post 6 does work.
Also note you will get zero's for the empty cells with shg's version so you may want to adjust for that or you may not mind that.
 
Upvote 0

Forum statistics

Threads
1,216,446
Messages
6,130,699
Members
449,586
Latest member
spg5150

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