Google-sheets – Merge column headings into one cell based on a specific value

google sheets

I am relatively new to Google Spreadsheets. I would like to use spreadsheets to better analyze classroom data.
I am trying to write a formula to merge column headings into one cell based on a specific value. In the example below, I would like every column heading that has a 0 for a particular student to be written in one cell:

My goal is this:

intended result

I've been searching through forums without much luck. Any advice to get me started would be much appreciated.

Best Answer

Try this formula for cell H2:

=JOIN(", ", FILTER(B$1:E$1, B2:E2 = 0))

This filters the header row (B1:E1) on values from B2:E2 which has the value 0. The resulting strings are joined with ,.

You can copy this formula to the other cells in column H by dragging it across. The B2:E2 will adjust automatically to match the other rows.

Feel free to look at and copy the example spreadsheet I've set up.