Google Sheets: Array result was not expanded because it would overwrite data
Hi, it's BlueByte. When Google Sheets shows #REF! with the note Array result was not expanded because it would overwrite data in [cell], your formula is fine — it produced a block of results, but something already sits in the cells that block needs, so Sheets refuses to paint over your data. A close cousin is an ARRAYFORMULA that returns only one row instead of filling the column. We'll walk through both, why they happen, how to confirm which one you've got, fix each with the output to expect, and keep the spill working.
What "Array result was not expanded" means
Some formulas return more than one value — FILTER, SORT, UNIQUE, IMPORTRANGE, or anything wrapped in ARRAYFORMULA. Sheets tries to spill that block starting from the cell you typed it in, filling the neighbouring cells to the right and below. If any target cell already holds a value it can't, because silently overwriting your data would be worse than erroring:
#REF!
Array result was not expanded because it would overwrite data in B5.The cell it names (B5 here) is the first occupied cell in the way. This is not a broken formula — it ran, produced a result, and had nowhere to put it.
The two symptoms people confuse
Two distinct problems look related:
- A blocked spill — the
#REF!above. The formula wants several cells and one is taken. - A formula that only fills one row — you wrote
=A2:A*B2:Bexpecting a whole column of products, but only row 2 calculates. The formula isn't array-aware, so it never tried to spill.
They have opposite causes: the first spilled and was blocked; the second never spilled at all. Tell them apart before you reach for a fix.
Why an array result gets blocked or stays put
The blocked-#REF! case comes from one of:
- Data below or beside the formula — a value typed into the spill range, often a stray entry several rows down.
- Another formula's output landing in the same cells.
- A merged cell inside the target range — merged cells can't receive a spilled value.
The one-row case has a different root: a plain arithmetic or lookup formula over ranges that Sheets won't auto-expand, so it needs an explicit ARRAYFORMULA wrapper — or the two ranges you're combining aren't the same size.
Confirm what's in the way and whether the formula is array-aware
Don't guess which cell blocks it — the message names one, but there may be more. Count the non-empty cells below the formula in the column the result should fill:
=COUNTA(B2:B1000)If that's higher than the header rows you expect, something is parked in the spill range. For the one-row problem, check whether the formula is wrapped: an ARRAYFORMULA shows its function prefix in the formula bar. Google's docs note that many array formulas expand into neighbouring cells automatically, and that pressing Ctrl+Shift+Enter while editing adds the ARRAYFORMULA( prefix for you.
Clear the cells the result needs (the #REF! fix)
Once you know what's blocking the spill, empty those cells — delete the stray values, or move the array formula to a clear column:
=FILTER(A2:A, A2:A<>"")With the target column empty below the formula, the same FILTER that returned #REF! now spills the whole result. If a merged cell is in the way, select the range and choose Format ▸ Merge cells ▸ Unmerge, then let the formula expand. Expected result: the #REF! disappears and the values fill down from the formula cell.
Make a one-row formula spill down the whole column
For the "only row 2 calculates" case, wrap the operation in ARRAYFORMULA and use open-ended ranges so new rows are covered:
=ARRAYFORMULA(A2:A * B2:B)Google's reference describes the argument as "a range, mathematical expression using one cell range or multiple ranges of the same size, or a function that returns a result greater than one cell." That same-size rule matters: A2:A * B2:B10 mixes an open range with a fixed one and errors. Guard blank rows with a condition so empty inputs don't return zeros:
=ARRAYFORMULA(IF(A2:A="", "", A2:A * B2:B))A real case: a header typed into the spill range
You put =SORT(FILTER(A2:D, C2:C>0), 1, TRUE) in F2 to build a live table. It shows #REF! — Array result was not expanded because it would overwrite data in F8. You scroll down and find a note someone typed into F8 weeks ago. You cut that note to another sheet, and the instant F8 is empty the sorted table spills from F2 down past F8 with no error. The formula was correct the whole time; it just needed the room.
Verify the spill and keep it from recurring
Click the formula cell: a correct spill highlights the whole filled block, and COUNTA() over the range now matches the number of rows the formula produced. To keep it working: put array formulas at the top of a dedicated, otherwise-empty column so nothing can grow into their spill range; avoid merged cells in any region a formula feeds; and prefer open-ended ranges (A2:A) over fixed ones so added rows stay covered. If collaborators keep typing under a spill, protect the range with Data ▸ Protect sheets and ranges.
How this differs from Excel's #SPILL! and a #N/A
The idea matches Excel, but the surface differs. Excel blocks a dynamic-array spill with #SPILL! and the note "Spill range isn't blank"; Google Sheets uses #REF! with "Array result was not expanded." Both mean the result had nowhere to land, but they're different products with different error tokens, so a control written for one — Excel's spill anchor, for instance — isn't there in the other. And neither is a #N/A: that means a lookup found no match, a value problem, not a spill-room problem.
Related questions
The message names one cell, but clearing it didn't fix the #REF!.
There's more than one occupied cell in the spill range; Sheets only reports the first. Select the whole column the result should fill and clear every stray value, or move the formula to an empty column with room to expand.
Do I still need ARRAYFORMULA if my function already returns an array?
No. FILTER, SORT, UNIQUE, and IMPORTRANGE spill on their own. ARRAYFORMULA is for making a non-array operation — like A2:A*B2:B or a per-row IF — expand across a range instead of computing a single cell.
My ARRAYFORMULA returns 0 for empty rows.
The open-ended range includes blank cells, and a blank multiplied by a number is 0. Wrap it in IF(A2:A="", "", …) so empty rows return blank instead of a zero.
It says the ranges must be the same size.
You mixed an open range with a fixed one, e.g. A2:A * B2:B10. Make both open (A2:A, B2:B) or both the same fixed height so every row has a matching partner on the other side.
Can a merged cell cause this?
Yes. A merged cell inside the spill range can't receive a value, so the array can't expand and you get the #REF!. Unmerge the range with Format ▸ Merge cells ▸ Unmerge and the formula fills normally.
References
Haneul Seo
Infrastructure engineer · 10+ years running Linux fleets
More in this category
Gmail rejects your mail with 550-5.7.26: unauthenticated email is not accepted due to the domain's DMARC policy
Gmail enforced the DMARC policy your own domain publishes: the message failed both SPF and DKIM alignment against the header From: domain, so a p=quarantine or p=reject policy turned it into a hard bounce. The Authentication-Results header names the failing check, and three dig queries against your SPF, DMARC and DKIM records name the cause. A near-identical bounce about authenticating with SPF or DKIM is a different problem — Gmail's baseline sender requirements, not your policy.
Microsoft Entra ID: AADSTS50011, the redirect URI specified in the request does not match the redirect URIs configured for the application
Sign-in completes and then Entra ID refuses the last hop, because the redirect_uri your app sent is not a byte-for-byte match for any URI registered on the app. The match is case-sensitive, counts the trailing slash, requires https outside localhost, and treats the port as significant everywhere except localhost. It also splits by platform: web, spa and publicClient are three separate lists, and URIs added to the service principal instead of the application object can disappear. Read the URI and the app ID out of the error, compare them with az ad app show, add the exact string with az ad app update or a Graph PATCH, then wait three to five minutes.
Exchange Online: 535 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled
A scanner, script or app that sends through smtp.office365.com gets 535 5.7.139 because the SMTP AUTH protocol is switched off for the tenant, for that mailbox, or by an authentication policy or security defaults that block Basic authentication. Read the wording (Tenant, Mailbox, or 'did not meet the criteria'), confirm with Get-TransportConfig, Get-CASMailbox and Get-AuthenticationPolicy, then open SMTP AUTH on the one mailbox that needs it rather than tenant-wide. Treat Basic SMTP AUTH as a bridge: Microsoft disables it by default for existing tenants at the end of December 2026, so move the sender to OAuth, High Volume Email or a relay connector.
Zoom: "Unable to connect" error code 5003 — the desktop app can't reach Zoom while the browser can
Error 5003 is the Zoom desktop app failing to complete its connection to Zoom's servers while the web client on the same machine joins fine. The app needs more than a browser does: Zoom's firewall article lists TCP 443/8801/8802 and UDP 3478/3479/8801–8810 for meetings, a set of CA hosts for certificate validation, and it asks that zoom.us and *.zoom.us be exempted from proxy or SSL inspection. A port test, a curl issuer check, and the app's built-in Network Connectivity Tool (Ctrl+Alt+Shift+D / Cmd+Option+Shift+D) show which of those is cut; fix that layer, and reinstall only when a single machine fails while its neighbours join.
Slack: "Slack cannot connect" and the grey "Last updated…" banner behind a corporate proxy
Slack loads channels over ordinary HTTPS but delivers new messages over a persistent WebSocket on port 443 to the three wss-*.slack.com hosts Slack names (primary, backup, mobile). When a proxy or firewall passes the HTTP side and blocks the upgrade — most often because SSL decryption is on for the wss hosts, or the allowlist stops at slack.com — the app shows the grey "Last updated…" banner or "Slack cannot connect." while the browser seems fine. Two curl probes from the affected machine show which layer is blocked; exempt the three wss hosts from decryption, allow every domain on my.slack.com/help/urls, and confirm with my.slack.com/help/test.
Word: "The document is locked for editing by another user"
Word found a lock — an owner file — for the document and assumed someone else has it open, so it offers only a read-only copy. Usually no one does: a crash left the lock behind, or a hidden Word process is still holding the file. Confirm which, close every Word instance, delete the stale ~$ owner file, and the document opens for editing again.