My formula should be looking through the green table to identify any rows that match the yellow heading of either nurse, addiction professional, etc. Then if it finds a match it should be coming back with a joined array of all of the matches and inserting them in the cell.
For the yellow table I am using the formula:
=IFNA(IF(REGEXMATCH(QUERY(CoveredP, "SELECT G where E contains '"&E$1&"'"),$D2), JOIN(", ",QUERY(CoveredP, "SELECT C where E contains '"&E$1&"'")), "No"),"No")
&E$1& focusing on the E from E1 changes to F, G, etc. as we move horizontally,
$D2, focusing on the 2 from D2 changes to 3, 4, 5 etc., as we move vertically.