I have a table I need to look through and return the first row where every corresponding value in the second row is "Yes"
In my case this would mean: "TA", and "RA"
+-----+----+-----+
| TA | SA | RA |
+-----+----+-----+
| Yes | No | Yes |
+-----+----+-----+
Is there a way to combine these values into a single Excel cell separated by commas?
So that a single cell will contain "TA, RA"
What formula I've used is store all values into an array and then have that array write to adjacent cells all values with yes and then combine them with substitute function.
=IFERROR(INDEX($A$1:$C$1,1,IFERROR(SMALL(IF($A1:$A3="Yes",COLUMN($A1:$A3)),ROW(1:1)), "")), "")
=SUBSTITUTE(TRIM(A1&" "&B1&" "&C1&" "&D1&" "&D1)," ",", ")
This will turn:
+----+----+
| TA | RA |
+----+----+
into:
+--------+
| TA, RA |
+--------+
Is there a quicker/cleaner way to build this function to return all the values that match to "Yes" into a single cell separated by commas?