In this Excel Nested XLOOKUP (Dynamic Lookup Value) Tutorial, you learn how to create an Excel nested XLOOKUP (dynamic lookup value) formula, where the lookup value for one XLOOKUP depends on the result of another XLOOKUP.
The XLOOKUP function is available in Excel 2021 and later (including Excel 365).
This Excel Nested XLOOKUP (Dynamic Lookup Value) Tutorial is accompanied by an Excel workbook with the data and formulas I use. Get this example workbook (for free) by clicking the button below.
Table of Contents
Related Excel Training Materials and Resources
The following Excel VLookup Tutorials may help you better understand the differences between the XLOOKUP and VLOOKUP functions (XLOOKUP vs. VLOOKUP).
- Excel VLOOKUP Tutorial (under development): Click here to open.
- Excel VLOOKUP from Another Sheet: Click here to open.
- Excel VLOOKUP Compare 2 Columns and Find Matches: Click here to open.
- Excel VLookup Sum Multiple Row Values (in Same Column): Click here to open.
- Excel VLOOKUP Multiple Columns: Click here to open.
- Excel VLOOKUP Sum Multiple Columns (Values): Click here to open.
- Excel VLookup Sum Multiple Column Values (with XLOOKUP): Click here to open.
- Excel VLookup Sum Multiple Rows and Columns: Click here to open.
- Excel VLookup Multiple Criteria with INDEX MATCH: Click here to open.
- Excel VLookup Multiple Criteria with XLOOKUP: Click here to open.
- Excel VLookup Multiple Criteria with the FILTER Function: Click here to open.
- Excel VLOOKUP Return Multiple Values with Helper Column: Click here to open.
- Excel VLookup Return Multiple Values with the INDEX Function: Click here to open.
- Excel VLookup Return Multiple Values with the FILTER Function: Click here to open.
- Excel VLookup Return Multiple Values in One Cell Separated by a Comma: Click here to open.
- Excel VLOOKUP Multiple Sheets: Click here to open.
- Excel VLOOKUP Multiple Sheets in Different Workbook: Click here to open.
- Excel VLOOKUP Sheet in Multiple Different Workbooks: Click here to open.
This Excel Nested XLOOKUP (Dynamic Lookup Value) Tutorial is part of a more comprehensive series of Excel XLOOKUP Tutorials.
- Excel XLOOKUP Tutorial: Click here to open.
- Excel XLOOKUP in Table: Click here to open.
- Excel Nested XLOOKUP (Dynamic Lookup Value): Click here to open.
- Excel XLOOKUP If Not Found Return Blank: Click here to open.
- Excel IF XLOOKUP (for Error Handling): Click here to open.
- Excel XLOOKUP If Blank Return Blank: Click here to open.
- Excel XLOOKUP Wildcard: Click here to open.
- Excel XLOOKUP Between 2 Values: Click here to open.
- Excel XLookup Return All Matches: Click here to open.
You can find more Excel and VBA Tutorials in the organized Tutorials Archive: Click here to visit the Archives. The following are some of my most popular Excel Tutorials and Training Resources:
- Excel Keyboard Shortcuts Cheat Sheet: Click here to open.
- Excel Power Query (Get & Transform) Tutorial for Beginners: Click here to open.
- Excel Macro Tutorial for Beginners: Click here to open.
If you want to learn more about Excel essentials, Excel formulas, and similar Excel topics, you may be interested in taking one (or more) Excel Courses: Click here to learn more about these Excel Courses (affiliate link).
If you want to learn how to automate Excel (and save time) by working with macros and VBA, you may be interested in the following Premium Excel Macro and VBA Training Materials:
- Premium Courses at the Power Spreadsheets Academy: Click here to open.
- Books at the Power Spreadsheets Library: Click here to open.
If you need help with Excel tasks/projects, you may be interested in working with me: Click here to learn more about working with me.
Excel Nested XLOOKUP (Dynamic Lookup Value) Formula Template/Structure
'Source: https://powerspreadsheets.com/
'More information: https://powerspreadsheets.com/excel-nested-xlookup-value/
=XLOOKUP(XLOOKUP(LookupValue1,ColumnOrRowWhereYouDoFirstSearch,ColumnOrRowWithValueToReturnFirst),ColumnOrRowWhereYouDoSecondSearch,ColumnOrRowWithFinalValueToReturn)
Step-by-Step Process to Create an Excel Nested XLOOKUP (Dynamic Lookup Value) Formula
(1) Call the XLOOKUP function.
'Source: https://powerspreadsheets.com/
'More information: https://powerspreadsheets.com/excel-nested-xlookup-value/
=XLOOKUP(...)
When you create a nested XLOOKUP (dynamic lookup value) formula, the lookup value for one (the dependent) XLOOKUP depends on the result of another (the independent) XLOOKUP. The XLOOKUP function you call in this step #1 (and whose arguments you specify in steps #2 to #4) is the independent XLOOKUP.
(2) Use the first argument of the XLOOKUP function (lookup_value) to specify the first lookup value.
The lookup value you specify in this step #2 is:
- The lookup value for the independent XLOOKUP.
- The value you search for in the first column (when doing a VLookup) or row (when doing an HLookup) you search in (and specify in step #3).
'Source: https://powerspreadsheets.com/
'More information: https://powerspreadsheets.com/excel-nested-xlookup-value/
=XLOOKUP(LookupValue1,...)
(3) Use the second argument of the XLOOKUP function (lookup_array) to specify the first lookup array.
The lookup array you specify in this step #3 is:
- The lookup array for the independent XLOOKUP.
- The column (when doing a VLookup) or row (when doing an HLookup) where you search for the lookup value (you specified in step #2).
As a general rule: Specify the lookup array as:
- A single-column (1 column, several rows) cell range, when doing a VLookup; or
- A single-row (1 row, several columns) cell range, when doing an HLookup.
'Source: https://powerspreadsheets.com/
'More information: https://powerspreadsheets.com/excel-nested-xlookup-value/
=XLOOKUP(LookupValue1,ColumnOrRowWhereYouDoFirstSearch,...)
(4) Use the third argument of the XLOOKUP function (return_array) to specify the first return array.
The return array you specify in this step #4 is:
- The return array for the independent XLOOKUP.
- The column (when doing a VLookup) or row (when doing an HLookup) with the first value to return. This value (returned by the independent XLOOKUP you created in steps #1 to #4) is (in turn) the lookup value for the dependent XLOOKUP (you create in steps #5 to #7).
Ensure the number of rows (when doing a VLookup) or columns (when doing an HLookup) of the return array (you specify in this step #4) is the same as that of the corresponding lookup array (you specified in step #3).
'Source: https://powerspreadsheets.com/
'More information: https://powerspreadsheets.com/excel-nested-xlookup-value/
=XLOOKUP(LookupValue1,ColumnOrRowWhereYouDoFirstSearch,ColumnOrRowWithValueToReturnFirst)
(5) Call the XLOOKUP function (a second time) and set its first argument (lookup_value) to the independent XLOOKUP function you created in steps #1 to #4.
'Source: https://powerspreadsheets.com/
'More information: https://powerspreadsheets.com/excel-nested-xlookup-value/
=XLOOKUP(XLOOKUP(LookupValue1,ColumnOrRowWhereYouDoFirstSearch,ColumnOrRowWithValueToReturnFirst),...)
When you create a nested XLOOKUP (dynamic lookup value) formula, the lookup value for one (the dependent) XLOOKUP depends on the result of another (the independent) XLOOKUP. The XLOOKUP function you call in this step #5 (and whose arguments you specify in steps #6 and #7) is the dependent XLOOKUP.
(6) Use the second argument of the XLOOKUP function (lookup_array) to specify the second lookup array.
The lookup array you specify in this step #6 is:
- The lookup array for the dependent XLOOKUP.
- The column (when doing a VLookup) or row (when doing an HLookup) where you search for the value returned by the independent XLOOKUP you created in steps #1 to #4.
As a general rule: When creating a nested XLOOKUP (dynamic lookup value) formula, specify the lookup array as:
- A single-column (1 column, several rows) cell range, when doing a VLookup; or
- A single-row (1 row, several columns) cell range, when doing an HLookup.
'Source: https://powerspreadsheets.com/
'More information: https://powerspreadsheets.com/excel-nested-xlookup-value/
=XLOOKUP(XLOOKUP(LookupValue1,ColumnOrRowWhereYouDoFirstSearch,ColumnOrRowWithValueToReturnFirst),ColumnOrRowWhereYouDoSecondSearch,...)
(7) Use the third argument of the XLOOKUP function (return_array) to specify the second return array.
The return array you specify in this step #7 is:
- The return array for the dependent XLOOKUP.
- The column (when doing a VLookup) or row (when doing an HLookup) with the value to return. This value (returned by the dependent XLOOKUP you created in steps #5 to #7) is the final value returned by the nested XLOOKUP (dynamic lookup value) formula.
Ensure the number of rows (when doing a VLookup) or columns (when doing an HLookup) of the return array (you specify in this step #7) is the same as that of the corresponding lookup array (you specified in step #6).
'Source: https://powerspreadsheets.com/
'More information: https://powerspreadsheets.com/excel-nested-xlookup-value/
=XLOOKUP(XLOOKUP(LookupValue1,ColumnOrRowWhereYouDoFirstSearch,ColumnOrRowWithValueToReturnFirst),ColumnOrRowWhereYouDoSecondSearch,ColumnOrRowWithFinalValueToReturn)
How (and Why) the Nested XLOOKUP (Dynamic Lookup Value) Formula Works
Consider using a nested XLOOKUP (dynamic lookup value) formula when the lookup value for one (the dependent) XLOOKUP depends on the result of another (the independent) XLOOKUP.
The nested XLOOKUP (dynamic lookup value) formula template/structure you learned above:
- Passes the result of one (the independent) XLOOKUP);
- As lookup value for a second (dependent) XLOOKUP.
Excel Nested XLOOKUP (Dynamic Lookup Value) Example Formula
This Excel Nested XLOOKUP (Dynamic Lookup Value) Tutorial is accompanied by an Excel workbook with the data and formulas I use. Get this example workbook (for free) by clicking the button below.
Excel Nested XLOOKUP (Dynamic Lookup Value) Example Worksheet
The example worksheet has 4 tables/sections with the following characteristics:
(1) Table 1 (cells A6 to B16).
The first table:
- With data.
- Where I search with the nested XLOOKUP (dynamic lookup value) example formula.
This is the table the independent XLOOKUP works with.
(2) Table 2 (cells A18 to H28).
The second table:
- With the data.
- Where I search with the nested XLOOKUP (dynamic lookup value) example formula.
This is the table the dependent XLOOKUP works with.
(3) First lookup value (cells J6 and K6).
The first lookup value (ID 058) is stored in cell K6.
(4) Nested XLOOKUP (dynamic lookup value) example formula (cells J8 to K9).
- Cell J9:
- Stores the nested XLOOKUP (dynamic lookup value) example formula; and
- Displays the results.
- Cell K9 displays the nested XLOOKUP (dynamic lookup value) example formula I enter in cell J9.
Excel Nested XLOOKUP (Dynamic Lookup Value) Example Formula
The nested XLOOKUP (dynamic lookup value) example formula stored in cell J9 is as follows:
'Source: https://powerspreadsheets.com/
'More information: https://powerspreadsheets.com/excel-nested-xlookup-value/
=XLOOKUP(XLOOKUP(K6,A7:A16,B7:B16),A19:A28,H19:H28)
The first lookup value (stored in cell K6) is “ID 058”.
The independent XLOOKUP:
- Finds the first lookup value (ID 058) in row 13 (cell A13) in the first column I search in with the nested XLOOKUP (dynamic lookup value) example formula (cells A7 to A16); and
- Returns the value stored in row 13 (Salesperson 36, in cell B13) of the applicable column (cells B7 to B16).
The dependent XLOOKUP:
- Find the value returned by the independent XLOOKUP (Salesperson 36) in row 20 (cell A20) of the second column I search in with the nested XLOOKUP (dynamic lookup value) example formula (cells A19 to A28); and
- Returns the value stored in row 20 (cell H20) of the applicable column (cells H19 to H28).
Download the Excel Nested XLOOKUP (Dynamic Lookup Value) Example Workbook
This Excel Nested XLOOKUP (Dynamic Lookup Value) Tutorial is accompanied by an Excel workbook with the data and formulas I use. Get this example workbook (for free) by clicking the button below.
Related Excel Training Materials and Resources
The following Excel VLookup Tutorials may help you better understand the differences between the XLOOKUP and VLOOKUP functions (XLOOKUP vs. VLOOKUP).
- Excel VLOOKUP Tutorial (under development): Click here to open.
- Excel VLOOKUP from Another Sheet: Click here to open.
- Excel VLOOKUP Compare 2 Columns and Find Matches: Click here to open.
- Excel VLookup Sum Multiple Row Values (in Same Column): Click here to open.
- Excel VLOOKUP Multiple Columns: Click here to open.
- Excel VLOOKUP Sum Multiple Columns (Values): Click here to open.
- Excel VLookup Sum Multiple Column Values (with XLOOKUP): Click here to open.
- Excel VLookup Sum Multiple Rows and Columns: Click here to open.
- Excel VLookup Multiple Criteria with INDEX MATCH: Click here to open.
- Excel VLookup Multiple Criteria with XLOOKUP: Click here to open.
- Excel VLookup Multiple Criteria with the FILTER Function: Click here to open.
- Excel VLOOKUP Return Multiple Values with Helper Column: Click here to open.
- Excel VLookup Return Multiple Values with the INDEX Function: Click here to open.
- Excel VLookup Return Multiple Values with the FILTER Function: Click here to open.
- Excel VLookup Return Multiple Values in One Cell Separated by a Comma: Click here to open.
- Excel VLOOKUP Multiple Sheets: Click here to open.
- Excel VLOOKUP Multiple Sheets in Different Workbook: Click here to open.
- Excel VLOOKUP Sheet in Multiple Different Workbooks: Click here to open.
This Excel Nested XLOOKUP (Dynamic Lookup Value) Tutorial is part of a more comprehensive series of Excel XLOOKUP Tutorials.
- Excel XLOOKUP Tutorial: Click here to open.
- Excel XLOOKUP in Table: Click here to open.
- Excel Nested XLOOKUP (Dynamic Lookup Value): Click here to open.
- Excel XLOOKUP If Not Found Return Blank: Click here to open.
- Excel IF XLOOKUP (for Error Handling): Click here to open.
- Excel XLOOKUP If Blank Return Blank: Click here to open.
- Excel XLOOKUP Wildcard: Click here to open.
- Excel XLOOKUP Between 2 Values: Click here to open.
- Excel XLookup Return All Matches: Click here to open.
You can find more Excel and VBA Tutorials in the organized Tutorials Archive: Click here to visit the Archives. The following are some of my most popular Excel Tutorials and Training Resources:
- Excel Keyboard Shortcuts Cheat Sheet: Click here to open.
- Excel Power Query (Get & Transform) Tutorial for Beginners: Click here to open.
- Excel Macro Tutorial for Beginners: Click here to open.
If you want to learn more about Excel essentials, Excel formulas, and similar Excel topics, you may be interested in taking one (or more) Excel Courses: Click here to learn more about these Excel Courses (affiliate link).
If you want to learn how to automate Excel (and save time) by working with macros and VBA, you may be interested in the following Premium Excel Macro and VBA Training Materials:
- Premium Courses at the Power Spreadsheets Academy: Click here to open.
- Books at the Power Spreadsheets Library: Click here to open.
If you need help with Excel tasks/projects, you may be interested in working with me: Click here to learn more about working with me.