Find header based on cell value

Akinrotimi

Board Regular
Joined
Aug 8, 2011
Messages
87
Hello,

I have a dataset where I want to locate the person with a value in a particular row.

The table below is on range A1:E5


BoyleHayleCoyleNeliCoile
-1750178139-142
-1750178139-142
-1750178139-142
-1750178139-142

<tbody>
</tbody>


I want to search for the recipient of any value on any row,for example 139 should be Neli for all the rows in the above example.

Expected result is :
-175BOYLE
178COYLE
139NELI
-142COILE

<tbody>
</tbody>

Every help would be appreciated.

Thanks
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Maybe something like this:
This is an array formula and must be entered with CTRL-SHIFT-ENTER.
Drag formula down as needed.
Excel Workbook
ABCDE
1BoyleHayleCoyleNeliCoile
2-1750178139-142
3-1750178139-142
4-1750178139-142
5-1750178139-142
6
7
8-175Boyle
9178Coyle
10139Neli
11-142Coile
Sheet
 
Upvote 0
Hi.


<tbody></tbody>
ABCDE
1BoyleHayleCoyleNeliCoile
2-1750178139-142
3-1750178139-142
4-1750178139-142
5-1750178139-142
6
7
8-175Boyle
90Hayle
10178Coyle
11139Neli
12-142Coile

<colgroup><col width="64" span="6" style="width:48pt"> </colgroup><tbody>
</tbody>

<colgroup><col width="64" span="6" style="width:48pt"> </colgroup><tbody>
</tbody>

Code in Cell B9: =INDEX($B$2:$F$2,MATCH(B9,$B$3:$F$3,0)).

This code can be copied down into cells B9:B12.

Hope this helps.
 
Upvote 0
If the real data contain duplicate occurrences across columns...


Book1
ABCDEFGHIJ
1BoyleHayleCoyleNeliCoile
2-1750178139-142139HayleNeli
3-1750178139-142178Coyle
4-175139178139-142
5-1750178139-142
Sheet1


In I2 control+shift+enter, not just enter, copy across, and down:

=IFERROR(INDEX($A$1:$E$1,SMALL(IF(FREQUENCY(IF($A$2:$E$5=$H2,MATCH($A$1:$E$1,$A$1:$E$1,0)),TRANSPOSE(COLUMN($A$1:$E$1)-COLUMN($A$1)+1)),TRANSPOSE(COLUMN($A$1:$E$1)-COLUMN($A$1)+1)),COLUMNS($I2:I2))),"")
 
Upvote 0
Thanks AhoyNC

I however noticed that it selects a negative number where there are contras.Foir example if D3 is changed to -178, the result become Neli and not Coyle for 178. Please help adjust.

Thanks
 
Upvote 0
Thanks Aladin

I noticed that even when we swap A2 and C2 (such that A2 is 178 while C2 is -175 for Coyle) for example,the result for row 2 would still be BOYle when it should be Coyle.This is because another row has BOYLE on the an earlier column.

Please help with this slight issue left.

Thanks a lot
 
Upvote 0
Thanks Aladin

I noticed that even when we swap A2 and C2 (such that A2 is 178 while C2 is -175 for Coyle) for example,the result for row 2 would still be BOYle when it should be Coyle.This is because another row has BOYLE on the an earlier column.

Please help with this slight issue left.

Thanks a lot

When A2 = 178 and C2 = -175, I get for 178 the following headers: Boyle then Coyle.

Control+shift+enter: Press down the control and the shift keys at the same while you hit the enter key. If this is done successfully, Excel itself puts a pair of { and } aroud the formula in recognition.
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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