Multiple Lookup between headers/rows help

Dani_LobP

Board Regular
Joined
Aug 16, 2019
Messages
137
Office Version
  1. 365
Platform
  1. Windows
Hello,

I am trying some ambitious formula and can't seem to even manage Copilot to assist me to figure out a simple way. hopefuly here I will find a solution.

The context:

I have 2 tables. One with some Contacts, that have some headers, and each header represent a group of items.
Then i have another table, where i have those headers, as rows, and each one representing another group of items.
Something like the below:

Table Contacts
Contacts NamesGroup1Group2Group3Group4
Contact1
Contact2
Contact3

Table Items
GroupItem
Group1Item1
Group1Item2
Group1Item3
Group2Item4
Group3Item5
Group3Item6
Group4Item7

In the Table Contacts, each contact will have an X on each column when they fit a group. If they have an X in group 1, it would mean that they would have items 1 to 3 assigned.

I have a 3rd table, where i have basically a copy of Table Items, but where i added all contacts as headers. To merge both tables.

And what i want, is a formula or a way, to automate the population of the data, so whenever a Contact has an X on a group in the Table Contacts, it will populate the 3rd table, for each row where the group matches.

Something as per below:

Table Contacts
Contacts NamesGroup1Group2Group3
Contact1XX
Contact2X
Contact3X

Final Table
GroupItemContact1Contact2Contact3
Group1Item1XX
Group1Item2XX
Group1Item3XX
Group2Item4X
Group3Item5X
Group3Item6X

The Final Table, is not really a table, because i would like it to have dynamic rows/headers, so whenevr a contact is added, a new header will appear, and whenever a new group/item is added, a new row would be added.
I did this part with Unique, for rows, and unique transpose for headers, but also am welcome for better options.

Hope it makes sense and look forward for any suggestion and help from you all!

thanks in advance!
 
Maybe:

Book3
ABCDEFGHIJ
1Contact NamesGroup1Group2Group3
2Contact1XX
3Contact2X
4Contact3X
5
6
7
8
9
10Final Table
11GroupItemContact1Contact2Contact3
12GroupItemGroup1Item1XX
13Group1Item1Group1Item2XX
14Group1Item2Group1Item3XX
15Group1Item3Group2Item4X
16Group2Item4Group3Item5X
17Group3Item5Group3Item6X
18Group3Item6Group4Item7
19Group4Item7
20
Sheet2
Cell Formulas
RangeFormula
E11:I18E11=LET(t,FILTER(A13:B25,A13:A25<>""),h,TRANSPOSE(FILTER(A2:A9,A2:A9<>"")),d,INDEX(B2:G9,MATCH(h,A2:A9,0),MATCH(INDEX(t,0,1),B1:G1,0))&"",IFERROR(HSTACK(VSTACK(A12:B12,t),VSTACK(h,d)),""))
Dynamic array formulas.
 
Upvote 0
Solution
I did this part with Unique, for rows, and unique transpose for headers,
This might need further explanation &/or samples as I am not seeing anything in your sample data that would require "unique".

I am also wondering if breaking the task up a bit, making the formulas shorter, might worth it. IF you have the Trim Refs notation available in your 365 version then perhaps something like this.

25 04 12.xlsm
ABCDEFGHIJ
1Contacts NamesGroup1Group2Group3Group4
2Contact1XX
3Contact2X
4Contact3X
5
6
7
8
9
10
11GroupItemContact1Contact2Contact3
12GroupItemGroup1Item1XX
13Group1Item1Group1Item2XX
14Group1Item2Group1Item3XX
15Group1Item3Group2Item4X
16Group2Item4Group3Item5X
17Group3Item5Group3Item6X
18Group3Item6Group4Item7
19Group4Item7
20
21
Tables
Cell Formulas
RangeFormula
E11:F18E11=A12:.B30
G11:I11G11=TRANSPOSE(A2:.A10)
G12:I18G12=INDEX(B2:J10,XMATCH(G11#,A2:A10),XMATCH(E12:.E30,B1:J1))&""
Dynamic array formulas.
 
Upvote 0
This might need further explanation &/or samples as I am not seeing anything in your sample data that would require "unique".

I am also wondering if breaking the task up a bit, making the formulas shorter, might worth it. IF you have the Trim Refs notation available in your 365 version then perhaps something like this.
Thanks! adapted it a bit together with Erik response. :)
 
Upvote 0

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