Return Table Header from Value in Table

MarkAn

Board Regular
Joined
Sep 28, 2005
Messages
69
Office Version
  1. 2010
Hi
I am trying to do the following:
On Sheet3, I have a table, the table headers are Names of Team Leaders I.e. TeamA, TeamB, TeamC etc.
The table lists the names of the team members under each leader I.e. TeamA has MemberAA, MemberAB, MemberAC etc.

On Sheet2, I have the list of all the Members in ColumnA
In ColumnB, I would like to input a formula that will search the table on Sheet3 and return the Header/Team Leaders name they are assigned to.

I have tried Index&Match, and XLookup and nothing will search the whole table and return the corresponding Team Leader name.

Can anyone please help.
Regards
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Is the table on Sheet3 a formal Excel table (ListObject) - usually identified by colour-band formatting?
 
Upvote 0
Hi

Yes I formatted the table into a formal Excel table (should I unformat it?)
I believe my office are using Excel 2010

Thanks
MarkAn
 
Upvote 0
Thanks for updating your details. (y)

See if this would work for you. In the formula, check/adjust the table name & heading of the first table column.
MarkAn.xlsm
ABC
1TeamATeamBTeamC
2MemberA1MemberB1MemberC1
3MemberA2MemberB2MemberC2
4MemberA3MemberB3MemberC3
5MemberA4MemberB4MemberC4
6MemberA5MemberB5MemberC5
Sheet3


MarkAn.xlsm
AB
1NameTeam
2MemberB3TeamB
3MemberA2TeamA
4MemberA1TeamA
5MemberA4TeamA
6MemberA5TeamA
7MemberA3TeamA
8MemberB4TeamB
9MemberC5TeamC
10MemberB2TeamB
11MemberC2TeamC
12MemberC4TeamC
13MemberB1TeamB
14MemberC3TeamC
15MemberB5TeamB
16MemberC1TeamC
Sheet2
Cell Formulas
RangeFormula
B2:B16B2=INDEX(Table1[#Headers],AGGREGATE(15,6,(COLUMN(Table1)-COLUMN(Table1[TeamA])+1)/(Table1=A2),1))
 
Upvote 0
Thanks for updating your details. (y)

See if this would work for you. In the formula, check/adjust the table name & heading of the first table column.
MarkAn.xlsm
ABC
1TeamATeamBTeamC
2MemberA1MemberB1MemberC1
3MemberA2MemberB2MemberC2
4MemberA3MemberB3MemberC3
5MemberA4MemberB4MemberC4
6MemberA5MemberB5MemberC5
Sheet3


MarkAn.xlsm
AB
1NameTeam
2MemberB3TeamB
3MemberA2TeamA
4MemberA1TeamA
5MemberA4TeamA
6MemberA5TeamA
7MemberA3TeamA
8MemberB4TeamB
9MemberC5TeamC
10MemberB2TeamB
11MemberC2TeamC
12MemberC4TeamC
13MemberB1TeamB
14MemberC3TeamC
15MemberB5TeamB
16MemberC1TeamC
Sheet2
Cell Formulas
RangeFormula
B2:B16B2=INDEX(Table1[#Headers],AGGREGATE(15,6,(COLUMN(Table1)-COLUMN(Table1[TeamA])+1)/(Table1=A2),1))


That has worked a treat, I appreciate your help
 
Last edited by a moderator:
Upvote 0
You're welcome. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,216,077
Messages
6,128,684
Members
449,463
Latest member
Jojomen56

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