Can you upload a sample file, and a manual example of what the result should be. It does not sound too difficult, but I fail to understand from your posted example.
It turns out to be less easy (for me).
Seems you would need a VBA written function (User Defined Function).
Like here http://www.eileenslounge.com/viewtopic.php?f=27&t=12298#
both CONCATENATEIF and CONCATENATEIFS avaiable.
or...
If you have Excel 2016 with the 365 subscription, you could use TEXTJOIN
=TEXTJOIN(",", TRUE, IF(A2:F2 = G2,A$1:F$1, ""))
Enter with CONTROL + SHIFT + ENTER.
or...
wait for some true ninja wit...
Hi Bosco, no miracle solution for this one? If there would be new names in new columns, the formula must be updated. Very pleased to see you do write down-to-earth-formulas too.
Hi Luis, I guess your best choice is using one of the UDF-macros. And then making it variable with a helper column, or a nested function.
I did something with Power Query (also available in Excel 2013, if activated) that also worked for the uploaded sample. But I would need to make it variable, so it can work with more names and more rows and more criteria?
If you could elaborate a bit on the "variables", then perhaps some-one here can propose a working solution for you.