Use XLOOKUP with a Linked Value from Another Excel Sheet
Question details
Use a linked employee ID from another worksheet as an XLOOKUP value and identify why the lookup may return an error.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- An employee ID linked from another worksheet changes daily and is used to find a matching record.
- Observed behavior
- The lookup returns an error when using the linked value, but the exact error and formula are not provided.
Locate the cell containing the linked employee ID and the columns containing the lookup IDs and results. Note the exact error message and whether the linked value comes from another worksheet or a separate workbook.
Check the XLOOKUP references and matching values
Use this method to verify that the linked ID and lookup range contain compatible values.
Select the result cell and inspect the formula bar. For example, =XLOOKUP(Sheet1!A2,Sheet2!A2:A100,Sheet2!B2:B100,"Not found") looks up the linked value in Sheet1!A2 against IDs in Sheet2 and returns the corresponding value from column B.
Select the linked ID and a matching ID in the lookup range. Use formulas such as =ISNUMBER(Sheet1!A2) and =ISTEXT(Sheet1!A2) in empty cells to check whether one ID is a number and the other is text. Convert the values to the same type while preserving any significant leading zeros.
Inspect the ID cells for leading or trailing spaces. If appropriate, use =TRIM(A2) in a helper column to remove ordinary extra spaces from text IDs, then use the cleaned values in the lookup.
Enter a known matching ID in a test cell and use that cell as the XLOOKUP lookup value. If it works, inspect the linked ID and its source; if it does not, recheck the lookup and return ranges.

Refresh and check the linked source
Use this method if the employee ID comes from a separate workbook or does not update when the source changes.
Use a Linked Worksheet Value in WPS Spreadsheets
In a WPS Spreadsheets version that supports XLOOKUP, reference the linked ID cell and matching columns to return the corresponding record.
- 1. Open the workbook: Open WPS Spreadsheets and select Open to load your workbook.
- 2. Locate the ranges: Select the worksheet containing the linked ID and note its cell reference. Then select the lookup worksheet and identify the ID and result columns.
- 3. Enter the lookup formula: Select an empty result cell and enter =XLOOKUP(Sheet1!A2,Sheet2!A2:A100,Sheet2!B2:B100,"Not found"), adjusting the sheet names and ranges for your workbook.
- 4. Verify the result: Press Enter and compare the result with a known ID. If it shows "Not found," check the linked value for data-type differences or extra spaces.

Frequently Asked Questions
Can XLOOKUP use a cell linked from another worksheet?
Yes. Reference the linked cell as the lookup value, such as Sheet1!A2. XLOOKUP uses the value in that cell, regardless of whether it was entered directly or produced by a formula.
Why does XLOOKUP return a not-found result for an ID that looks identical?
The linked ID may be text while the lookup ID is a number, or one value may contain extra spaces. Use ISNUMBER or ISTEXT to compare types and inspect the cells for spaces.
How do I reference a worksheet name that contains spaces?
Enclose the sheet name in single quotes, for example, 'Employee Data'!A2. Use the same syntax when referencing lookup or return ranges on that sheet.
Why does the linked ID not change when the source changes?
Check the linked cell's formula and confirm the source is accessible. For external data connections, try Data > Refresh All; for workbook links, check Data > Workbook Links or Edit Links where available. Also check Formulas > Calculation Options > Automatic.




