search a text and return the column head

srkreignz

New Member
Joined
Aug 22, 2014
Messages
27
Hi,

I would like to search for a text in a table and return the column head.

Eg: Table A!:C5

[TABLE="width: 500"]
<tbody>[TR]
[TD]Sl No

[/TD]
[TD] Manager[/TD]
[TD]Trainee[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]John[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]Steve [/TD]
[TD]Jeffy[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]Harry[/TD]
[TD]Johnson[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Johny[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


I wud like to search for john(lower case) in say D2 and get Manger in E2.

Tried the formula
=INDEX(A1:C5,1,MATCH("*"&D2&"*",A2:C5,0))
But not working. Please help !!
 
Last edited:

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,225,476
Messages
6,185,197
Members
453,282
Latest member
roger_nz66

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