Sub topic 10
Looking up values on another sheet
In real workbooks the data you want to look up rarely sits next to the formula. A price list lives on one tab, orders on another, and employees on a third. This chapter covers how to point VLOOKUP and XLOOKUP at a different sheet, how to keep those references stable when you copy formulas, and what breaks when sheets are renamed, deleted, or moved to a separate file.
It assumes you can enter formulas, read ranges such as A2:C100, use $ for absolute references, and write a basic VLOOKUP or XLOOKUP. The earlier chapters in this tutorial cover those.
The sheet reference syntax
To refer to a range on another sheet, write the sheet name, an exclamation mark, then the range:
Products!A2:C100A lookup function treats that reference like any other range. Nothing about VLOOKUP or XLOOKUP changes. Only the range arguments gain a sheet prefix.
Sheet names with spaces or symbols
If the sheet name contains a space, punctuation, or starts with a digit, wrap the name in single quotes:
'Price List'!A2:C100If the name itself contains an apostrophe, double it inside the quotes. A sheet called Bob's Data is written like this:
'Bob''s Data'!A2:C100When you build the reference by clicking on the other tab while editing a formula, Sheets adds the quotes for you. Quotes are only a problem when you type references by hand.
A worked example
Suppose the workbook has two sheets.
The Products sheet holds the reference data:
| Row | A (ID) | B (Name) | C (Price) |
|---|---|---|---|
| 1 | ID | Name | Price |
| 2 | P-101 | Widget | 4.50 |
| 3 | P-102 | Gadget | 12.00 |
| 4 | P-103 | Gizmo | 7.25 |
The Orders sheet holds one row per order line. Column A has the product ID, column B has the quantity, and you want column C to show the unit price.
With XLOOKUP, enter this in Orders!C2:
=XLOOKUP(A2, Products!A:A, Products!C:C, "Not found")The key A2 is on the current sheet. The lookup range Products!A:A and the result range Products!C:C are both on Products. The fourth argument is the missing-value text from the earlier chapter on missing keys.
The VLOOKUP version needs one range that spans the key column and the result column. The column index counts from the first column of that range:
=VLOOKUP(A2, Products!A:C, 3, FALSE)Column C is the third column of A:C, so the index is 3. The index is relative to the range you give, not to the sheet. If you wrote Products!B:C, the key column would be B, and the price would be index 2. That would not match the product IDs in column A.
Absolute references when you fill down
If you copy =XLOOKUP(A2, Products!A:A, Products!C:C) down to row 3, the key becomes A3, which is what you want. A bounded range such as Products!A2:A100 also shifts down by one row, and that is a bug. By row 50 the lookup range starts at A50 and misses the top of the table. Lock bounded ranges with $:
=XLOOKUP(A2, Products!$A$2:$A$100, Products!$C$2:$C$100, "Not found")Whole-column references like Products!A:A cannot drift when copied down, so many people use them for cross-sheet lookups. The trade-offs:
| Style | Example | Strength | Weakness |
|---|---|---|---|
| Whole column | `Products!A:A` | New rows are included automatically. Cannot drift. | Includes the header row. Scans every row of the sheet. |
| Bounded and locked | `Products!$A$2:$A$100` | Explicit. Skips the header. | Rows added below row 100 are ignored. |
| Open-ended bounded | `Products!$A$2:$A` | Skips the header, grows with the data. | Slightly less common, so readers may need a second look. |
For lookups, the header row in a whole-column range is rarely a problem, because a key like P-102 will not match the text ID. It becomes a problem if a key could equal a header, or if you use approximate matching on a column that mixes text and numbers.
Ranges must line up in XLOOKUP
XLOOKUP takes the position of the match in the lookup range and returns the item at the same position in the result range. The two ranges can sit on different sheets, but they must cover the same rows. This formula is wrong because the ranges start on different rows:
=XLOOKUP(A2, Products!A2:A100, Products!C1:C99)Every result is off by one row. A mismatch in size, such as A2:A100 against C2:C50, returns an error instead of a quietly wrong answer. The off-by-one case is more dangerous because it returns a plausible value. When you write the ranges, check that both start and end on the same row numbers.
VLOOKUP does not have this risk, because it uses a single range.
What happens when the sheet changes
Formulas follow the sheet, not the name you typed. Four common events behave differently:
| Event | Result in the formula |
|---|---|
| You rename the `Products` sheet | Sheets rewrites every formula to use the new name. |
| You move the `Products` tab to a different position | No change. |
| You delete the `Products` sheet | Formulas return `#REF!`. |
| You insert or delete rows inside the referenced range | The range expands or shrinks to match. |
Deleting the source sheet cannot be fixed with IFNA or a missing-value argument. #REF! means the reference itself is broken, not that the key was missing. You need to restore the sheet (undo, or version history under File) or rewrite the references.
Also be careful when you insert rows at the very end of a bounded range. If your range is $A$2:$A$100 and you insert a row after row 100, the new row is not included. Inserting a row in the middle of the range does expand it.
Looking up in a different spreadsheet file
A sheet reference only works within the same spreadsheet file. To search data in another file, use IMPORTRANGE, which returns a range from a file you have access to:
=VLOOKUP(A2, IMPORTRANGE("https://docs.google.com/spreadsheets/d/FILE_ID", "Products!A2:C100"), 3, FALSE)Replace FILE_ID with the ID from the other file's URL. The first time you use it, Sheets shows #REF! with a prompt to allow access. Click Allow access once, and the formula resolves.
Some points to know about this approach:
- The lookup now depends on the other file. If it is deleted, or you lose permission, the formula fails.
- Each
IMPORTRANGEcall is a separate import. A column of 1,000 lookups can trigger 1,000 imports. - A common alternative is to import the whole table once into a helper sheet, then point your lookups at the helper sheet using normal sheet references.
With XLOOKUP you would need two IMPORTRANGE calls, one for each range. VLOOKUP needs one, so it is often simpler for this case.
Choosing the sheet from a cell
Sometimes the sheet name is data, for example one price tab per region, with the region name in a cell. INDIRECT builds a reference from text:
=XLOOKUP(A2, INDIRECT("'" & B2 & "'!A:A"), INDIRECT("'" & B2 & "'!C:C"), "Not found")If B2 holds West, the formula searches 'West'!A:A and returns from 'West'!C:C. The quotes inside the string handle names with spaces.
INDIRECT has costs. It is volatile, so it recalculates whenever anything in the sheet changes. It also does not follow renames, because the sheet name is just text. If someone renames West to West Region, the formula returns #REF!. Use it only when the sheet name must come from a cell.
Checking a cross-sheet lookup
When a cross-sheet lookup returns #N/A, check these in order:
- The key exists on the lookup sheet. Search the column with Ctrl+F.
- The key and the lookup column have the same type. A number stored as text will not match a real number.
- No hidden spaces surround the key. Use
TRIMon the key if needed. - The range points at the right column. In VLOOKUP, the key must be in the first column of the range.
- For
#REF!, the sheet name is spelled correctly and the sheet still exists.
Cross-sheet lookups add one new failure type, the wrong-sheet reference. Click into the formula and Sheets highlights each range in colour on its own sheet, so you can confirm that both ranges point where you think they do.
Exercise
The tab is named Price List 2026. Write an XLOOKUP in Orders!C2 that looks up the ID in A2 against column A of that tab, returns column C, shows "Not found" for missing keys, and can be filled down without the range shifting.
Show answer
=XLOOKUP(A2, 'Price List 2026'!$A$2:$A$100, 'Price List 2026'!$C$2:$C$100, "Not found"). The single quotes are needed because the name contains spaces. The $ signs lock both ranges so filling down only changes the key. The ranges both span rows 2 to 100, so they stay aligned. Using 'Price List 2026'!A:A and 'Price List 2026'!C:C would also work, since whole columns cannot shift.
Exercise
A colleague deletes the Products tab, and your lookups now show #REF!. Will wrapping them in IFNA(..., "Not found") hide the problem? Why or why not?
Show answer
No. IFNA only catches #N/A, which is what a missing key produces. #REF! means the reference itself is broken, so IFNA passes it through. Restore the sheet with undo or version history, or rewrite the formulas to point at an existing sheet.