How to do a 2D Lookup in Excel? Let’s start.
When we want to find an intersection between a row and a column basing on headers, we can do it in two different ways. The first one will be in Legacy Excel, and the second in Dynamic Array Excel.
The first solution uses the MATCH function as well as its close friend, the INDEX function.
Let’s start with looking for the country. In this case we want to find the row number. Let’s write the cell, the range where we will be looking for and 0 for an exact match (Fig. 1)
=MATCH(B8,A3:A6,0)

We also want to find the column number. In this case we also use the MATCH function. Let’s the cell, the range where we will be looking for and 0 for an exact match (Fig. 2)
=MATCH(B9,B2:G2,0)

When we have our row and column numbers, we can use the INDEX function, select the whole dataset, then write the row and column numbers (Fig. 3)
=INDEX(B3:G6,D8,D9)

Just like that, we did the 2D lookup, or we have found the values we wanted (Fig. 4)

So far, we have had three formulas. If we want to have only one, we need to implement some modifications. We have to copy our MATCH function and paste it in the place referring to cell D8. Then, we have to copy the second MATCH function without the equal sign, and paste it in the place of the reference to cell D9. Now, we have one, bigger formula instead of three smaller ones (Fig. 5)
=INDEX(B3:G6,MATCH(B8,A3:A6,0),MATCH(B9,B2:G2,0))

Now, let’s focus on the solution in the Array Excel. We will be using here the XLOOKUP function twice.
First, we are looking for a row in the country headers. Then, as a returning array, we give Excel the whole dataset (Fig. 6)
=XLOOKUP(B8,A3:A6,B3:G6)

Since I’m using the XLOOKUP function, and we are working in the Array Excel, Excel will return the whole row.
In such a case, we have to find a proper column. We can also do it with the XLOOKUP function. Let’s write the XLOOKUP function once again. This time we will be looking for a month in the month headers. As a return array, we have the row we found previously (Fig. 7)
=XLOOKUP(B9,B2:G2,XLOOKUP(B8,A3:A6,B3:G6))

And just like that, we have our results (Fig. 8)

Even if we change the values in our formula, the result is still correct (Fig. 9)

The results are correct both in XLOOKUPs and INDEX with MATCH functions.