How to Fix the #SPILL! Error

#SPILL! means a formula returns several values but Excel cannot place them in the cells below or beside it. Something is in the way: other data, a merged cell, or an Excel table. Describe the result you want below and get a formula that fits your sheet.

Free, no sign-up required · 5 free generations a day

Last updated

Describe your task, get the formula

Type what you need in plain English, or pick an example below. You get the formula, a step-by-step explanation, and a worked example.

Formulas that control how results spill

Syntax
=UNIQUE(A2:A100)
=@A2:A100
=INDEX(SORT(A2:A100),1)

A dynamic array formula fills as many cells as it has results, starting from the cell it is typed in. The @ operator returns only the value from the formula's own row, and INDEX picks one item from the array, so neither needs room to spill.

Examples

Spill a sorted list of unique values

=SORT(UNIQUE(A2:A100))

Returns every distinct value from the range in order. The cells below the formula must be empty, as many as there are results.

Return only the first result

=INDEX(FILTER(B2:B100,A2:A100="East"),1)

FILTER would spill every matching row. INDEX with 1 keeps only the first, so the formula fits in a single cell.

Use a sized range instead of a whole column

=A2:A100*2

Spills 99 results. Writing =A:A*2 in row 2 fails with #SPILL! because more than a million results would run past the bottom of the sheet.

Common mistakes and how to fix them

The spill range is not blank

Select the error cell: a dashed border shows where the results need to go. Delete or move whatever is inside that area. A cell containing only a space counts as occupied.

The formula is inside an Excel table

Tables do not support spilled arrays. Move the formula outside the table, or convert the table to a normal range with Table Design, Convert to Range.

The spill range contains merged cells

Unmerge the cells in the area the formula needs. Spilled results cannot be written into a merged cell.

Frequently asked questions

What does #SPILL! mean?

It means a formula produced several results, called a dynamic array, and Excel could not write them into the neighbouring cells.

Which versions of Excel have #SPILL!?

Excel 2021, Excel 2024 and Microsoft 365, which support dynamic arrays. Older versions return a single value or need Ctrl+Shift+Enter instead.

Does Google Sheets have a #SPILL! error?

No. Google Sheets reports the same problem as #REF! with the message that the array result was not expanded because it would overwrite data. The fix is the same: clear the cells in the way.

Don't want to write it by hand?

Describe what you need in plain English and get a ready-to-use formula in seconds.

Try the formula generator