How to Do a Two-Way Lookup with Nested XLOOKUP in Excel

Find the value where a row and a column meet by nesting one XLOOKUP inside another — in either order, even with wildcards.

You will learn to

  • Nest XLOOKUP to look up by row and column
  • Swap the nesting order and get the same answer
  • Use a partial name with a wildcard inside a two-way lookup

How it works

A two-way lookup finds the value where a row label and a column header cross. With XLOOKUP, the inner lookup returns a whole column and the outer lookup picks the row from it: =XLOOKUP(paint,A2:A9,XLOOKUP(size,B1:E1,B2:E9)). The inner formula searches the size headers and returns that column of prices.

You can nest the other way round — return the paint’s row first, then pick the size from it. Both give the same answer. Every XLOOKUP feature still works, so a wildcard (match_mode 2) lets someone type just the start of a product name.

=XLOOKUP(H1,A2:A9,XLOOKUP(H2,B1:E1,B2:E9))