IMPORTRANGE #REF! After Allow Access in Google Sheets
After Allow access, IMPORTRANGE can still show #REF!. Read the message: a bad ID, a bad tab or range, a blocked spill, or a request that is too large.
本文目录
You already clicked Allow access, or these two files have been connected before, and the IMPORTRANGE cell still shows #REF!. Don’t start by granting permission again. Read the message on the cell. Google Sheets uses the same #REF! name for several different failures.
If the message is “You need to connect these spreadsheets,” the destination file has not been allowed to read this source yet. That case is covered in how to connect sheets for IMPORTRANGE. On 19 November 2026, in a desktop browser with the Google account display language set to English, one Allow access click authorized every IMPORTRANGE pointing at that source file, and the data appeared after a few seconds. The English prompt was: “You need to connect these spreadsheets. The first time the destination spreadsheet pulls data from a new source spreadsheet, permission is needed to be granted.” The buttons were Learn more and Allow access.
This page is for the other messages, the ones that remain after that permission is already in place, or that appear even before it.
A small warehouse transfer list
The source spreadsheet has a tab named Nov Transfers, with this table in A1:E7. All of the sample data is fictional.
| Date | Warehouse | Requested by | SKU | Units |
|---|---|---|---|---|
| 2026-11-03 | North Depot | Lina Ortiz | BX-104 | 24 |
| 2026-11-04 | East Hub | Brett Keene | PK-218 | 18 |
| 2026-11-06 | South Depot | Sofi Tran | CT-330 | 32 |
| 2026-11-09 | North Depot | Marcus Reed | BX-104 | 15 |
| 2026-11-12 | West Hub | Nadia Cole | MT-502 | 27 |
| 2026-11-16 | East Hub | Elena Cruz | PK-218 | 14 |
The six transfers add to 130 units. In the destination spreadsheet, the formula to come back to is:
=IMPORTRANGE("YOUR_SOURCE_ID","'Nov Transfers'!A1:E7")
YOUR_SOURCE_ID is a placeholder, not a real spreadsheet ID. In published formulas, use only that placeholder. The first argument is the source file’s ID, the part of a normal Google Sheets URL between /d/ 与 /edit. The second argument names the tab and a small range. Tab names that contain a space need single quotes inside that string.
Once the import succeeds, the header and six rows spill from the formula cell. If that formula is in A2, the units land in E3:E8, E3 is 24, and =SUM(E3:E8) in a cell outside the spill returns 130. That is what this destination file showed after Allow access.
Excel has no IMPORTRANGE function.
Spreadsheet cannot be found
A first argument that is not a real spreadsheet ID returns #REF! with the message “Spreadsheet cannot be found.” That message appeared both before the two files were connected and after Allow access, so a broken ID is distinguishable from a permission prompt.
Copy the ID from the source file’s address bar, only the part between /d/ 与 /edit. Don’t paste the destination file’s ID by mistake, and don’t leave the file in trash.
A URL suffix is not part of the ID. This pattern is the wrong thing to store as the first argument, even though it resolved in this test:
=IMPORTRANGE("YOUR_SOURCE_ID/edit?usp=sharing","'Nov Transfers'!A1:E7")
After Allow access, that suffix formula imported the same header and six transfer rows as the plain ID, once it had empty cells to spill into. I would still strip the suffix and use only the ID, so a later copy-paste does not depend on Sheets accepting the extra path.
When the tab or range is wrong
If the first argument is already correct and the files are connected, a typo in the second argument is the next place to look. The source tab in the sample is Nov Transfers, not November Transfers:
=IMPORTRANGE("YOUR_SOURCE_ID","'November Transfers'!A1:E7")
That formula returned #REF!, with the message “Cannot find range or sheet for imported range.”
The same message appeared for a range that names a column Sheets does not have, 'Nov Transfers'!A1:ZZZZZ7.
A range that runs one row past the last populated row is not automatically invalid. This formula leaves the tab name unquoted, which is the usual advice against when the name contains a space:
=IMPORTRANGE("YOUR_SOURCE_ID","Nov Transfers!A1:E8")
On this file, after Allow access and with empty cells under the formula, that unquoted range still imported the header and six data rows. I would still quote tab names that contain a space, so a more awkward name does not fail later, but the missing quotes were not what broke this import.
An omitted tab name can import the wrong sheet
This formula names a range and no tab:
=IMPORTRANGE("YOUR_SOURCE_ID","A1:E7")
Google’s IMPORTRANGE help says the sheet name is optional, and that the function imports from the first sheet by default. After Allow access, this formula filled with the first tab in the source file, not Nov Transfers. The first tab here is a decoy list: Old Yard, a requested-by value of Not Used, SKU XX-000, and a units value of 999. It looks like a successful import until you compare it with the 130-unit transfer list.
I would put the tab name in every production formula, even when the source file currently has only one sheet.
A request that is too large, or still loading
Google’s IMPORTRANGE help says each request is capped at 10 MB of received data. It does not give a fixed cell count. This six-row sample did not hit that cap. A formula that asked for 'Nov Transfers'!A:Z failed because another formula was sitting in its spill path, with the overwrite message below, not because the result was too large.
If a cell does report that the result is too large, shrink the range to the columns and rows you need, or summarize in the source file and import the summary. Google’s own example is to total in the source and import the single number rather than a million rows. On this source, =SUM(E2:E7) is already 130.
For a large table, importing in sections is a possible workaround:
=IMPORTRANGE("YOUR_SOURCE_ID","'Nov Transfers'!A1:E4")
=IMPORTRANGE("YOUR_SOURCE_ID","'Nov Transfers'!A5:E7")
After Allow access, the first section returned the header plus Lina Ortiz, Brett Keene, and Sofi Tran (units 24, 18, and 32, totaling 74). The second section returned Marcus Reed, Nadia Cole, and Elena Cruz (units 15, 27, and 14, totaling 56), with no header row. Each extra formula is another external request, so a source-side summary is usually the better design if you only need the total.
A formula that stays on a loading message is not the same as a bad tab name. Google’s help says that when import functions create too much traffic, the cell can show “Loading…” with the detailed message “Error Loading data may take a while because of the large number of requests. Try to reduce the amount of IMPORTHTML, IMPORTDATA, IMPORTFEED, or IMPORTXML functions across spreadsheets you’ve created.” The same page notes that if the first argument of IMPORTRANGE keeps changing, many external calls may be issued and can cause that throttle. I did not see a Loading… message on this small import. If you see it, cut down the number of import formulas and stop swapping the source ID or URL from a cell that changes often.
A blocked output range is a different error
Even a small import needs empty destination cells. If the working A1:E7 formula sits in I2 and the label blocker-in-I3 already sits in I3, the imported array cannot expand. The cell shows #REF!, and the message is “Array result was not expanded because it would overwrite data in I3.” That is a destination problem, not a missing source file or a permissions problem. See array result was not expanded.
The same overwrite message appeared when a valid suffix import, an unquoted-tab import, or a QUERY spill ran into a label that had been left in the next rows. Move the formula to a clear area, or clear the cells in its way, before you change the source reference.
Ordinary #REF! causes such as a deleted column or a bad INDIRECT are in #REF! error.
QUERY after the import already works
If a bare IMPORTRANGE already returns the six transfer rows, and a QUERY wrapped around it fails, the problem may be the query string rather than the import. QUERY of an imported array uses Col1, Col2, and so on, not the source file’s column letters.
This pattern failed:
=QUERY(IMPORTRANGE("YOUR_SOURCE_ID","'Nov Transfers'!A1:E7"),"select A, B",1)
The cell showed #N/A. The Sheets API returned no error message, and the desktop file showed no hover text. The same import with select *, or with this formula, returned the Date and Warehouse columns, including the header and all six transfer dates, once the spill had empty cells:
=QUERY(IMPORTRANGE("YOUR_SOURCE_ID","'Nov Transfers'!A1:E7"),"select Col1, Col2",1)
If the message is “Unable to parse query string,” see QUERY unable to parse. Put a plain IMPORTRANGE in an empty area first. If that direct import is still an error, fix the source reference before debugging the query.
Don’t hide the #REF! before reading it
IFERROR will hide a permission prompt, a missing spreadsheet, and a bad tab name behind the same fallback. Before authorization, a valid IMPORTRANGE wrapped in IFERROR(...,"Import unavailable") displayed Import unavailable. After Allow access, that wrapper showed the imported table, but the Date column displayed as serial numbers (46329, 46330, and so on) instead of 2026-11-03, because IFERROR does not keep the date format from the import. The same kind of wrapper around a misspelled tab name, with an empty fallback, stayed blank after authorization.
Leave the raw IMPORTRANGE visible until the message has been read and the ID, tab, and range are correct. A fallback can wait until the import itself is trusted.
For an IMPORTRANGE #REF! after the files have already been connected, start with the message on the cell. A garbage ID can show “Spreadsheet cannot be found” even after permission is granted. A connect prompt belongs in the Allow access article. Once the valid six-row import returns 130 units, add any QUERY or fallback around it.