Return Column Headers for Cells Matching Text

FuriousD

New Member
Joined
Sep 1, 2016
Messages
35
Office Version
  1. 365
Platform
  1. MacOS
Sorry if this has been handled. I searched and couldn't find this exact situation.

I'm trying to use index/match or similar to compare text (a name) in one cell to that of 4 other cells (columns). Then for whichever cell contains the match, my result is the column header. In the table below, I am using A2 to search B2:E2. When there is a match in the text, return the corresponding header title from B1:E1.

ABCDEF
1Completed ByManagerRecruiterAssistantAdminCompleted By Role
2Spano, JessieSpano, JessieSlater, ACMorris, ZachKapowski, KellyManager
3Barakus, BAFaceHannibalBarakus, BAMurdockAssistant
4D, FuriousLil Helper, SantasD, FuriousV, SnowballPoochieRecruiter

TIA
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
How about
+Fluff v2.xlsm
ABCDEF
1Completed ByManagerRecruiterAssistantAdminCompleted By Role
2Spano, JessieSpano, JessieSlater, ACMorris, ZachKapowski, KellyManager
3Barakus, BAFaceHannibalBarakus, BAMurdockAssistant
4D, FuriousLil Helper, SantasD, FuriousV, SnowballPoochieRecruiter
Master
Cell Formulas
RangeFormula
F2:F4F2=INDEX($B$1:$E$1,AGGREGATE(15,6,(COLUMN($B$1:$E$1)-COLUMN($B$1)+1)/($B$2:$E$4=A2),1))
 
Upvote 0
How about
+Fluff v2.xlsm
ABCDEF
1Completed ByManagerRecruiterAssistantAdminCompleted By Role
2Spano, JessieSpano, JessieSlater, ACMorris, ZachKapowski, KellyManager
3Barakus, BAFaceHannibalBarakus, BAMurdockAssistant
4D, FuriousLil Helper, SantasD, FuriousV, SnowballPoochieRecruiter
Master
Cell Formulas
RangeFormula
F2:F4F2=INDEX($B$1:$E$1,AGGREGATE(15,6,(COLUMN($B$1:$E$1)-COLUMN($B$1)+1)/($B$2:$E$4=A2),1))
Thanks - I'm getting the #NUM! Error when I update to my actual column/rows. Maybe I screwed something up in translation? I'll update to my actual columns...
 
Upvote 0
How about
+Fluff v2.xlsm
ABCDEF
1Completed ByManagerRecruiterAssistantAdminCompleted By Role
2Spano, JessieSpano, JessieSlater, ACMorris, ZachKapowski, KellyManager
3Barakus, BAFaceHannibalBarakus, BAMurdockAssistant
4D, FuriousLil Helper, SantasD, FuriousV, SnowballPoochieRecruiter
Master
Cell Formulas
RangeFormula
F2:F4F2=INDEX($B$1:$E$1,AGGREGATE(15,6,(COLUMN($B$1:$E$1)-COLUMN($B$1)+1)/($B$2:$E$4=A2),1))
HIJKLM
1Completed ByManagerRecruiterAssistantAdminCompleted By Role
2Spano, JessieSpano, JessieSlater, ACMorris, ZachKapowski, KellyManager
3Barakus, BAFaceHannibalBarakus, BAMurdockAssistant
4D, FuriousLil Helper, SantasD, FuriousV, SnowballPoochieRecruiter

Updated the Columns to reflect where they are actually in my sheet. TIA
 
Upvote 0
How did you change the formula?
 
Upvote 0
That's fine, which means you don't have a match. If you think there should be a match check for leading/trailing spaces, typos etc
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,184
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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