An XLOOKUP that works on the same sheet but returns #REF!, #NAME?, #VALUE! or the wrong value after you point it at another sheet is almost always a reference problem, not a formula problem. The three usual culprits are an unquoted sheet name containing a space, a range that does not start at the same row as the lookup value, or a lookup array that is narrower or wider than the return array. Fix the sheet reference first, then check that both ranges are the same height, and the formula will behave exactly as it does locally.
What You'll Need
- Excel 365, Excel 2021 or later, or Excel for the web — XLOOKUP does not exist in Excel 2019 or older, and typing it there returns #NAME? no matter how correct the reference is.
- The exact name of the source sheet as it appears on the sheet tab, including any spaces, hyphens or numbers.
- Both workbooks open if you are pulling from a different file, because closed workbooks cannot be referenced by XLOOKUP in the same way as open ones.
- A lookup column with no leading or trailing spaces, and matching data types on both sides (text stored as text, numbers stored as numbers).
Step-by-Step
- Confirm XLOOKUP is available. Start typing
=XLOOKUP(in a cell. If the function name does not appear in the autocomplete list, your Excel version does not support it. Use INDEX and MATCH instead, or open the file in Excel for the web or a Microsoft 365 desktop install. - Write the sheet reference correctly. A sheet name with no spaces needs no punctuation:
Sheet2!A2:A100. A sheet name with a space, hyphen or that starts with a number must be wrapped in single quotes:'Sales Data'!A2:A100. Missing quotes is the single most common cause of #REF! and #NAME? errors here. - Build the formula in the destination sheet, not the source sheet. Click the cell where the result should appear, type
=XLOOKUP(, then click the lookup value cell on the current sheet. Do not type the sheet name for the lookup value unless it genuinely lives elsewhere. - Point at the lookup array by clicking, not typing. Switch to the source sheet with the mouse and drag over the column that holds the matching values. Excel writes the sheet name and quotes for you, which removes the typo risk. Press comma to move to the next argument.
- Select the return array from the same starting row. If the lookup array is A2:A100, the return array must start at row 2 as well, for example C2:C100. Both ranges must contain the same number of rows. A mismatch produces #VALUE!.
- Add the not-found argument. Type a comma and then
"Not found"(in quotes) so missing matches return readable text instead of #N/A. This also makes it obvious whether the formula is failing or the value simply is not there. - Close the bracket and press Enter. If you see #REF!, the sheet name is wrong or the sheet was renamed or deleted. Check the tab name character by character, including double spaces.
- Copy down with absolute references if needed. If you plan to fill the formula down, lock the ranges with dollar signs:
'Sales Data'!$A$2:$A$100and'Sales Data'!$C$2:$C$100. Otherwise each copied row shifts the source range and returns the wrong record. - Test with a value you know exists. Pick a lookup value you can see in the source column and confirm the returned value matches. Then test one that does not exist and confirm your not-found text appears.
Menu labels and dialog wording vary slightly between Excel versions, platforms and regions, so if a button name looks different on your copy, the equivalent option is in the same place.
Common Mistakes
- Forgetting the single quotes around a sheet name with a space.
Sales Data!A2:A100fails;'Sales Data'!A2:A100works. - Mismatched range sizes. A lookup array of 99 rows and a return array of 100 rows throws #VALUE!. Count both or drag them together.
- Starting the return array on the wrong row. If the lookup array starts at row 2 but the return array starts at row 1, every answer is off by one row — a silent error that looks like wrong data rather than a broken formula.
- Text versus number mismatch. A number stored as text in one sheet will not match a real number in the other. Use the error-checking green triangle or convert with VALUE or TEXT to align the types.
- Hidden spaces. Values pasted from other systems often carry trailing spaces. TRIM the lookup column, or clean the source data.
- Referencing a closed workbook. External references to closed files can break or return stale values. Open both files, or copy the source data into the same workbook.
- Renaming the source sheet after building the formula. Excel updates references automatically only when the rename happens in the same session with the formula intact; a manual rename elsewhere leaves #REF! behind.
Tips
- Use the Formula Bar's colour-coded range outlines while editing — each argument lights up its range on the source sheet, so you can see instantly whether the rows line up.
- Convert the source range to an Excel Table and reference it as . Structured references survive inserted rows and column moves, and they never need sheet-name quoting.
- Set the match mode deliberately. The default is exact match (0); leave it there unless you specifically need a wildcard or approximate match.
- Name your key ranges with the Name Box (for example
CustomerIDs) so the formula reads clearly and the sheet reference is stored safely inside the name. - Keep lookup columns free of merged cells — merged cells return only the top-left value and quietly break matches.
Troubleshooting
#NAME? Either the Excel version does not support XLOOKUP, or the sheet name is unquoted and Excel reads it as a defined name. Check both.
#REF! The sheet name is misspelled, the sheet was deleted or renamed, or the quotes are missing. Click the reference in the formula bar and re-select the range by mouse.
#VALUE! The lookup array and return array are different sizes. Re-drag both ranges from the same starting row.
#N/A when the value clearly exists. Check for trailing spaces, number-versus-text storage, or a case or accent difference if you have changed the match mode. Also confirm you are looking at the right column — a common slip is selecting the adjacent column by one click.
Wrong value returned. Almost always an offset range. Verify the first row of both arrays.
Formula works but recalculates slowly. Full-column references like A:A across sheets are heavy. Limit the range to the rows you actually use.
If none of that helps, copy the source column into the destination sheet temporarily and run the same XLOOKUP locally. If it works there, the problem is the cross-sheet reference; if it fails there too, the problem is the data.
Frequently Asked Questions
Why does XLOOKUP work on one sheet but not another?
The formula itself is fine; the reference is not. Check the sheet name quoting, the row alignment of both ranges, and whether the source values are stored as the same data type.
Can XLOOKUP pull from a different workbook?
Yes, using an external reference such as '[Book2.xlsx]Sheet1'!A2:A100, but both workbooks should be open. For reliability, bring the data into the same workbook.
Do I need dollar signs in a cross-sheet XLOOKUP?
Only if you plan to copy the formula down or across. Absolute references keep the source range fixed so each row looks up the correct record.
Why does the sheet name need single quotes?
Excel uses quotes to mark anything inside the reference that is not a plain name. Spaces, hyphens and names beginning with a digit all require them.
Can I use XLOOKUP across sheets in Excel for the web?
Yes, cross-sheet references work in the browser version, provided the function is supported in your version and the workbook is saved in a modern format.
What replaces XLOOKUP in older Excel versions?
INDEX with MATCH, or VLOOKUP with a column index. Both handle cross-sheet references the same way, with the same quoting rules.