How to nest one lookup inside another in Excel
Formula (Excel and Google Sheets)
=XLOOKUP(XLOOKUP(H1,A2:A8,B2:B8),D2:D5,E2:E5)Use the result of the first lookup as the value of the second: =XLOOKUP(XLOOKUP(H1,A2:A8,B2:B8),D2:D5,E2:E5).
- Result on the example
- Yuki Sato in
H2 - Works in
- Excel 2021, 2024 and Microsoft 365
- Google Sheets
- Same formula
See it work
The formula is already in H2. Change any input and the result updates, or edit the formula to experiment.
How it works
The inner XLOOKUP finds Ines Lopez's department, IT. The outer XLOOKUP uses "IT" as its lookup value in the second table and returns the manager, Yuki Sato. Each lookup is an ordinary lookup; one simply feeds the other.
=XLOOKUP(XLOOKUP(H1,A2:A8,B2:B8),D2:D5,E2:E5)Result"Yuki Sato"
H1"Ines Lopez"The value in H1.
A2:A87 rows × 1 col: "Lena Park", "Omar Ruiz", "Noor Haddad", "Tom Becker", …A range: 7 cells in one column.
B2:B87 rows × 1 col: "Finance", "Sales", "IT", "Sales", …A range: 7 cells in one column.
XLOOKUP(H1,A2:A8,B2:B8)"IT"XLOOKUP: Searches one range and returns the matching item from another.- lookup_value
H1"Ines Lopez" - lookup_array
A2:A87 rows × 1 col: "Lena Park", "Omar Ruiz", "Noor Haddad", "Tom Becker", … - return_array
B2:B87 rows × 1 col: "Finance", "Sales", "IT", "Sales", …
- lookup_value
D2:D54 rows × 1 col: "Finance", "Sales", "IT", "Marketing"A range: 4 cells in one column.
E2:E54 rows × 1 col: "Carla Moretti", "Derek Hughes", "Yuki Sato", "Ana Souza"A range: 4 cells in one column.
XLOOKUP(XLOOKUP(H1,A2:A8,B2:B8),D2:D5,E2:E5)"Yuki Sato"XLOOKUP: Searches one range and returns the matching item from another.- lookup_value
XLOOKUP(H1,A2:A8,B2:B8)"IT" - lookup_array
D2:D54 rows × 1 col: "Finance", "Sales", "IT", "Marketing" - return_array
E2:E54 rows × 1 col: "Carla Moretti", "Derek Hughes", "Yuki Sato", "Ana Souza"
- lookup_value
In Google Sheets
The same formula works in Google Sheets: =XLOOKUP(XLOOKUP(H1,A2:A8,B2:B8),D2:D5,E2:E5). We ran it in Google Sheets mode on the same data and it returns Yuki Sato.
Other ways to do it
Each one was run on the same example sheet.
| Formula | Result | When to use it |
|---|---|---|
| =VLOOKUP(VLOOKUP(H1,A2:B8,2,FALSE),D2:E5,2,FALSE) | Yuki Sato | The same chain with VLOOKUP, for every version. |
| =LET(dept,XLOOKUP(H1,A2:A8,B2:B8),XLOOKUP(dept,D2:D5,E2:E5)) | Yuki Sato | LET names the middle result, which makes longer chains easier to read and check. |
Common mistakes
- If either step fails, the whole formula returns #N/A. Test the inner lookup on its own to see which step is missing a match.
- The middle value must be spelled the same in both tables: "IT" in one and "I.T." in the other never match.
Try it yourself
Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.
Nest one lookup inside another
H2, return the manager of the employee in H1: find the employee's department, then that department's manager.Questions
How do I show the department too?
Put the inner lookup in its own cell and refer to it, or return both with =HSTACK(dept,manager) inside LET.
Can I chain three tables?
Yes, nest one more level, or use LET with a name for each step.
Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.