Dynamic array functions such as FILTER, UNIQUE, SORT and SEQUENCE return several values that spill into neighbouring cells. When Excel cannot write those values, the formula cell shows #SPILL!. The warning icon next to it tells you which of the causes below applies.
The six causes, and the fix for each
1. Spill range isn't blank
Something sits where the results would go. Use Select Obstructing Cells, then clear or move it.
2. Spill range in table
Tables do not support spilled arrays. Put the formula beside the Table, or convert the Table to a range.
3. The result runs past the edge of the sheet
Usually a whole-column reference: =A:A*2 tries to return over a million rows. Use A2:A500, a Table column, or the trim reference A:.A, which stops at the last used row (see TRIMRANGE and trim references).
4. Merged cells
Unmerge any merged cells in the spill range.
5. Spill range is unknown
The size of the result keeps changing as Excel calculates - often a volatile function such as RANDARRAY or OFFSET feeding the array size. Make the size come from a stable cell.
6. Out of memory or extremely large result
Reduce the range the formula works on, or move the heavy step into Power Query.
Working with spill results
Refer to the whole result with a spill reference such as =E2# - for example as the source of a drop-down list. More on spilling in Dynamic arrays: the Excel feature you didn't know you had.
Still stuck?
Paste the formula into the free Excel Error Solver, or send it to the free Formula Clinic. Quick fixes get a free written quote (Excel error fixing). All guides are in the Excel error library.