-1

I have this 2d array table (image attached-table 1).

table 1

I want to extract column names for all tags which are marked with "x". For eg: For Tag 1, I want the values A and G returned. Similarly, for Tag 2, A, C and F should be returned. How should I do it in excel?

Thanks in anticipation.

CallumDA
  • 12,025
  • 6
  • 30
  • 52
Hellboy
  • 1
  • 1

2 Answers2

0

in I2 enter:

=MID(IF(B2="x","," & $B$1,"") & IF(C2="x","," & $C$1,"") & IF(D2="x","," & $D$1,"") & IF(E2="x","," & $E$1,"") & IF(F2="x","," & $F$1,"") & IF(G2="x","," & $G$1,"") &  IF(H2="x","," & $H$1,""),2,99)

and copy downwards:

enter image description here

Gary's Student
  • 95,722
  • 10
  • 59
  • 99
0
{=IFERROR(INDEX($A$1:$H$1,0,SMALL(IF(INDIRECT("$A$"&SMALL(IF($A$1:$A$5=B$7,ROW($A$1:$A$5)),1)&":$H$"&SMALL(IF($A$1:$A$5=B$7,ROW($A$1:$A$5)),1))="X",COLUMN($A$1:$H$1)),ROW(1:1))),"")}

You can then drag that down and across for all other rows. Assuming your data starts in A1, here is what it looks like:

.

rollstuhlfahrer
  • 3,988
  • 9
  • 25
  • 38
Ryan S
  • 41
  • 4