0

I would like to automate the process of generating a list of combinations determined by the result of an interaction matrix:

I have an interaction matrix. "x" denotes an interaction between two parts:

enter image description here

I have started the process of listing the combinations and have been able to list Part A items with their respective frequency:

enter image description here

I use the VLOOKUP function to compare the index value to the aggregate which is the cumulative sum of the "x" count for each Part A row.

What I would like is a method to look up a value in column R across table B4:L14 then find the instances of "x" in their respective rows and then lookup at row 4 which Part B corresponds to each "x" instance.

e.g. cells S5:S9 should have the values [2; 3; 4; 6; 9]

Q. Is this achievable using inbuilt functions, or will I have to write custom VBA code?

Much appreciated

1 Answers1

2

with Office 365:

=LET(
    rng,$C$5:$L$14,
    hd,$C$4:$L$4,
    rw,$B$5:$B$14,
    INDEX(FILTER(hd,FILTER(rng,rw=R5)="x"),,COUNTIF($R$5:R5,R5)))

enter image description here

Older versions

=INDEX($4:$4,AGGREGATE(15,7,COLUMN($C$5:$L$14)/(($B$5:$B$14=R5)*($C$5:$L$14="x")),COUNTIF($R$5:R5,R5)))

enter image description here

Scott Craner
  • 148,073
  • 10
  • 49
  • 81