Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trying to create a table where the columns are IDs, and the rows contain yes/no based on whether or not specific text is linked to the ID

I would like the result to look something like this.

ID1 ID2 ID3
Text 1 yes yes no
Text 2 yes no no
Text 3 no yes yes

And I have a table that looks like this. Notice that the text/strings can exist under multiple different IDs. Is there a way to use index/match for this? I've tried to use index/match, but to be honest I don't understand it that well.

ID1 ID2 ID3
Text 1 Text 1 Text 3
Text 2 Text 3 null
null null null

See above. I tried to use index/match, and it's just not making sense to me.

Edit: updated the tables so that values match. Sorry!

like image 881
ElphiusMostafa Avatar asked Jan 23 '26 04:01

ElphiusMostafa


1 Answers

Use a nested INDEX(MATCH) to return the correct column to a MATCH. Then test if the return is numeric:

=IF(ISNUMBER(MATCH($E2,INDEX($A$2:$C$4,0,MATCH(F$1,$A$1:$C$1,0)),0)),"yes","no")

enter image description here

like image 155
Scott Craner Avatar answered Jan 25 '26 23:01

Scott Craner



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!