Since you have merged cells in your table headings it makes it more difficult...

Try adding a helper row just above the table that combines the 2 row headers of rows 20 and 21. So in C16 add formula:

=LOOKUP(2,1/($C20:C20<>""),$C20:C20)&"_"&LOOKUP(2,1/($C21:C21<>""),$C21:C21)

and copy it across to R16.

Note: You can hide this row or colour the fonts to match background.

Then your lookup formula would be:

=INDEX($C$22:$R$40,MATCH(AA8,$B$22:$B$40),MATCH(Z8&"_"&X8,$C$16:$R$16,0))