Look at mutiple columns and return column header where the text matches

jezmechanic

New Member
Joined
May 7, 2019
Messages
5
Hi Folks

I am looking for some help.

So in "Case" tab I have a list of cases the company are dealing with. In column "I" within this tab contains the name of the worker who dealt with the case. In a separate tab ("Team Sheets") I have all the workers in the company listed based on which team they are in (example - Column "A" header is "Steve's Team" then below is a list of all the workers in Steve's team). I am looking for a formula that will look at the name of the worker within the "Case" tab (Column "I"), cross reference with the "Team Sheets" tab and return the header for whatever column the workers name matched.

Thanks
Jez
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Welcome to Mr Excel forum

Could you tell us where are the headers (row) and data (rows/columns) in Team Sheets tab?

M.
 
Upvote 0
Hi Marcelo, thank you.

Yeah so the columns in "Team Sheets" are columns A:P and the managers name are row 2 for each column followed by the workers listed immediately below.

Thanks
Jez
 
Upvote 0
Ok
Headers in A2:P2
Question
How many rows of data do you have? Rows 3 to 100, for example

M.
 
Upvote 0
Maybe something like this

Team Sheets tab

[Table="class: grid"][tr][td="bgcolor: #DCE6F1"][/td][td="bgcolor: #DCE6F1"]
A
[/td][td="bgcolor: #DCE6F1"]
B
[/td][td="bgcolor: #DCE6F1"]
C
[/td][/tr]
[tr][td="bgcolor: #DCE6F1"]
1
[/td][td][/td][td][/td][td][/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
2
[/td][td]
Steve's team​
[/td][td]
Mark's team​
[/td][td]
....​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
3
[/td][td]
Bob​
[/td][td]
Mary​
[/td][td][/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
4
[/td][td]
John​
[/td][td]
Richard​
[/td][td][/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
5
[/td][td][/td][td]
William​
[/td][td][/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
6
[/td][td][/td][td][/td][td][/td][/tr]
[/table]


Case tab

[Table="class: grid"][tr][td="bgcolor: #DCE6F1"][/td][td="bgcolor: #DCE6F1"]
I
[/td][td="bgcolor: #DCE6F1"]
J
[/td][/tr]
[tr][td="bgcolor: #DCE6F1"]
1
[/td][td]
Names​
[/td][td]
Team​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
2
[/td][td]
Bob​
[/td][td]
Steve's team​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
3
[/td][td]
Mary​
[/td][td]
Mark's team​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
4
[/td][td]
John​
[/td][td]
Steve's team​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
5
[/td][td]
Richard​
[/td][td]
Mark's team​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
6
[/td][td]
William​
[/td][td]
Mark's team​
[/td][/tr]
[/table]


Formula in J2 copied down
=INDEX('Team Sheets'!$A$2:$P$2,AGGREGATE(14,6,('Team Sheets'!$A$3:$P$17=I2)*COLUMN('Team Sheets'!$A$2:$P$2),1))

Hope this helps

M.
 
Upvote 0

Forum statistics

Threads
1,223,705
Messages
6,173,985
Members
452,540
Latest member
haasro02

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