As to task 1 paste the following into cell M3 and drag the fill handle down to M38:
Formula:
=IF(Q3="","",INDEX(A$3:A$6,AGGREGATE(15,6,(ROW(A$3:A$6)-ROW(A$2))/(B$3:J$6=Q3),1))&INDEX(B$2:J$2,AGGREGATE(15,6,(COLUMN(B$2:J$2)-COLUMN(A$2))/(B$3:J$6=Q3),1)))
Paste the following array formula** into cell N3, follow the instructions below for activating, and then double click the fill handle to copy the formula down:
Formula:
=IFERROR(INDIRECT(TEXT(SMALL(IF((B$3:J$6<>""),ROW(A$3:A$6)*100+COLUMN(B$1:J$1),10^10),ROWS(A$1:A1)),"R0C00"),)&"","")
**Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
As for task 2 paste the following into cell B13 and then drag the fill handle down:
Formula:
="MY_TABLE_"&INDEX(B$2:B$8,MATCH(A13,A$2:A$8,0))
Let us know if you have any questions.
Bookmarks