VLOOKUP Across Google Sheets Workbooks: How-To
In this article
You can use VLOOKUP to pull data from a different Google Sheets workbook, but not with a normal range reference. The working method is to import the other file's data into your sheet with IMPORTRANGE, then point VLOOKUP at that imported range. A direct cross-file VLOOKUP like =VLOOKUP(A2, 'Other Workbook'!A:B, 2, FALSE) does not work in Google Sheets; it returns an error because Sheets cannot resolve a range in a file that is not open in the same spreadsheet. The import-then-lookup approach is the one Google's own help pages describe for combining data across files.
What You'll Need
- Edit access to both the source workbook (where the lookup table lives) and the destination workbook (where you type the formula).
- The full URL of the source workbook, copied from the browser address bar. You need the part between
/d/and/edit. - A key column in both files that matches exactly, such as a product code, employee ID or email address.
- The source range should be clean: no merged header rows inside the data, and the key column should be the leftmost column of the range you import.
Step-by-Step
- Open the destination workbook, the one where you want the looked-up values to appear. Pick an empty area, for example a tab named Import, so the imported block does not sit on top of your own data.
- Copy the source workbook's URL from the address bar. It looks like
https://docs.google.com/spreadsheets/d/1AbC.../edit#gid=0. The long string after/d/is the spreadsheet ID. - In the destination sheet, click a cell where the imported data should start, then type
=IMPORTRANGE("PASTE_URL_HERE", "Sheet1!A:B"). Replace the URL with the one you copied and replaceSheet1!A:Bwith the actual tab name and columns from the source file. If the tab name contains spaces, wrap it in single quotes inside the double quotes, like'Sales Data'!A:C. - Press Enter. The first time you connect two files, the cell shows
#REF!with a message about access. Hover over the cell and click Allow access (sometimes labelled Connect sheets). This authorises the destination file to read the source file. You only do this once per pair of files. - Check that the imported block appears and that the first column contains your key values. If the columns are shifted, adjust the range in the formula, for example
"Sheet1!B:D"if the key is in column B. - Now write the VLOOKUP against the imported range. If IMPORTRANGE starts in cell A1 of the current sheet, use
=VLOOKUP(E2, $A:$C, 3, FALSE)where E2 holds the lookup key, A:C covers the imported columns and 3 is the column number to return. UseFALSEfor an exact match; this is almost always what you want when matching IDs or codes. - Copy the VLOOKUP formula down your column. Because the imported range is fixed in the same sheet, the references stay stable. If you placed the import on a separate tab, reference it as
Import!$A:$C. - Wrap the formula in
IFERRORto handle missing keys cleanly:=IFERROR(VLOOKUP(E2, $A:$C, 3, FALSE), "Not found"). Without this, any key that is absent from the source shows#N/A. - Test with a known key and a deliberately wrong key. If the known key returns the right value and the wrong key returns your fallback text, the setup is correct.
Common Mistakes
- Trying a direct cross-file range. Writing
'Other File'!A:Bin VLOOKUP does not work. Google Sheets needs the data inside the current file, which is why IMPORTRANGE comes first. - Forgetting to grant access. The
#REF!error on the first IMPORTRANGE is normal until you click Allow access. If you dismiss the prompt, the formula stays broken. - Wrong tab name or range. A tab called Q1 Sales must be written as
'Q1 Sales'!A:Cwith single quotes. Without them the formula errors. - Key column not first. VLOOKUP only searches the leftmost column of the range you give it. If your key is in column C, start the range at C, or use INDEX/MATCH instead.
- Using TRUE or omitting the last argument. The default is an approximate match, which returns wrong values on unsorted or text data. Always type
FALSEfor exact matching. - Mismatched data types. A number stored as text in one file will not match a real number in the other. Check with
ISNUMBERor trim spaces withTRIM. - Overwriting the import. Typing over the imported block breaks the formula. Keep the import on its own tab or a clear area.
Tips
- Import only the columns you need. IMPORTRANGE on a whole sheet is slower and can hit limits; a range like
A:Cis lighter. - If you need several lookups from the same source, import once and point every VLOOKUP at that one block. Do not repeat IMPORTRANGE in every formula.
- For large tables, INDEX/MATCH is often faster and can look left as well as right:
=INDEX(Import!C:C, MATCH(E2, Import!A:A, 0)). - Name the imported range (Data > Named ranges) so formulas read as
VLOOKUP(E2, PriceList, 3, FALSE). - Keep the source file's key column unique. Duplicate keys make VLOOKUP return the first match only.
- If the source is edited by others, expect the imported values to update automatically; there is no manual refresh button.
Troubleshooting
If the import shows #REF!, the access grant has not been given or the URL is wrong. Re-copy the URL from the address bar and click Allow access again. If it shows #N/A in the VLOOKUP, the key is not present in the imported range: check for trailing spaces, number-versus-text formatting, or a range that starts on the wrong column. If the import is stuck on Loading..., the source file may be very large or the range too broad; narrow it to the needed columns. If values return from the wrong row, you likely used approximate matching: change the last argument to FALSE. If the formula works for you but not for a colleague, they may lack edit access to the source file, so share it with them or have them grant access themselves. Finally, if the source workbook is moved to the trash or its permissions change, the import breaks; restore the file or re-grant access.
Frequently Asked Questions
Can VLOOKUP look directly into another Google Sheets file?
No. Google Sheets does not support cross-file range references in formulas. You must bring the data in with IMPORTRANGE (or a similar import function) and then run VLOOKUP on the imported range.
Why does IMPORTRANGE show #REF! the first time?
It is an authorisation step, not an error in your formula. Hover the cell and click Allow access to connect the two files. After that, the formula returns data.
Do both files need to be open?
No. Once access is granted, the destination file reads the source file even when the source is closed, as long as the source still exists and you retain access.
Can I use VLOOKUP with IMPORTRANGE on a different tab?
Yes. Put the IMPORTRANGE on a tab such as Import, then reference it from your main sheet as Import!$A:$C inside the VLOOKUP.
What if my lookup key is not in the first column of the source?
VLOOKUP cannot search leftwards. Either rearrange the imported range so the key is first, or switch to INDEX/MATCH, which can match on any column.
Does this work in the Google Sheets mobile app?
You can type and edit the formulas in the app, but the Allow access prompt and range selection are easier on a computer. If the mobile app will not let you grant access, open the file in a desktop browser once.