I have a sheet that looks like this:
I'd like to have a formula that queries the data in A2:E7 and pulls the corresponding column headers from A1:E1. The trick is that values may appear more than once.
Sample results would look like this:
Example sheet: https://docs.google.com/spreadsheets/d/1Zr_q8nwYPixUjxWYdT-WlQLiGIUzqoK_cSQXSp19nJg