When importing large volumes of data in Google Sheets, you might encounter the dreaded IMPORTRANGE “Result too large” error.
This happens when the number of cells being imported exceeds the function’s limits, which are undocumented and vary depending on the data type and user environment.
A practical solution is to break the data into parts and stitch it back together using VSTACK or HSTACK. These functions let you work around the IMPORTRANGE result too large error by importing manageable chunks.

Why IMPORTRANGE Fails with Large Datasets
The IMPORTRANGE function throws an #ERROR!
when it tries to import more cells than allowed. In one of my recent use cases, importing 26 columns and 20,000 rows triggered this issue. When I reduced it to 12,606 rows, it worked fine—showing that the exact threshold can vary.
Solution 1: Use VSTACK to Stack Rows
You can split the data by rows and use VSTACK
to combine them.
Formula Example:
=LET(
url, "https://docs.google.com/spreadsheets/d/1OiMbGNDOkzHu5DWaUvFSj_5cdq3rhvqu-ocWeXhbflo/edit#gid=1707494620",
VSTACK(
IMPORTRANGE(url, "Sheet1!A1:Z10000"),
IMPORTRANGE(url, "Sheet1!A10001:Z20000")
)
)
The LET function helps keep the formula cleaner by defining the spreadsheet URL once.
You can add more IMPORTRANGE
ranges within VSTACK
, just separate them with commas.
Solution 2: Use HSTACK to Stack Columns
If your dataset has too many columns, split them horizontally.
Formula Example:
=LET(
url, "https://docs.google.com/spreadsheets/d/1OiMbGNDOkzHu5DWaUvFSj_5cdq3rhvqu-ocWeXhbflo/edit#gid=1707494620",
HSTACK(
IMPORTRANGE(url, "Sheet1!A1:M20000"),
IMPORTRANGE(url, "Sheet1!N1:Z20000")
)
)
Each formula pulls half the columns, and HSTACK
combines them side by side.
Boost Performance Using QUERY
You can improve performance further by filtering unnecessary rows or columns using the QUERY function.
Filtering Rows with VSTACK + QUERY
=LET(
url, "https://docs.google.com/spreadsheets/d/1OiMbGNDOkzHu5DWaUvFSj_5cdq3rhvqu-ocWeXhbflo/edit#gid=1707494620",
VSTACK(
QUERY(IMPORTRANGE(url, "Sheet1!A1:Z10000"), "SELECT * WHERE Col1 IS NOT NULL"),
QUERY(IMPORTRANGE(url, "Sheet1!A10001:Z20000"), "SELECT * WHERE Col1 IS NOT NULL")
)
)
This removes blank rows and reduces the size of imported data.
Filtering Columns with HSTACK + QUERY
=LET(
url, "https://docs.google.com/spreadsheets/d/1OiMbGNDOkzHu5DWaUvFSj_5cdq3rhvqu-ocWeXhbflo/edit#gid=1707494620",
HSTACK(
QUERY(IMPORTRANGE(url, "Sheet1!A1:M20000"), "SELECT Col1, Col2, Col3"),
QUERY(IMPORTRANGE(url, "Sheet1!N1:Z20000"), "SELECT Col1, Col2, Col3")
)
)
Just remember that each IMPORTRANGE
range resets the column count for QUERY
. So in both chunks, you must use Col1
to Col13
.
Conclusion
To fix the IMPORTRANGE result too large error in Google Sheets:
- Split large datasets into smaller chunks using
VSTACK
(for rows) orHSTACK
(for columns). - Filter rows and columns using the
QUERY
function to reduce the number of imported cells. - Use the
LET
function to simplify long formulas and improve readability.
With these techniques, you can efficiently import large datasets without hitting the result too large error.