Dear, I can't see the column number, so I have to assume that it is the beginning of column A, for example, I wrote a formula. Please modify it yourself or ask me.
I2 Paste this formula and put it down:
=TRIM(IF(COUNTIF(A:A, G2), $ A $2& "","")& (countif (b: b, G2), $ B $2& "","")& (countif (c: c, G2).