Dear all, i need help to write a functions to perform a text matching and value extracting.

In Sheet 1:
column A is group name, column B is value matching column A

In Sheet 2:
i have 3 column, ABC, where each column will have a group name within it. D is returning value

How can i write a functions that matches the text from cell A1 B1 C1 (Sheet 2)with column A(Sheet 1),

the D columns(sheet 2) need to match the value of its respective A,B,C(sheet 2) with column A(Sheet 1) and extract matching values (Sheet 1column B). If there's multiple matching in column A, then it will extract multiple values. each returning value is seperated by a comma.

attached a sample file: samples - REVISED.xlsx

thanks a lot for any help extended.