How to Fix the #SPILL! Error in Excel
#SPILL! means a formula that fills several cells (FILTER, SORT, UNIQUE and so on) could not get room for its result. The most common cause is a value already sitting in the cells the result needs. Select the error cell to see the spill range outlined with a dashed border, then clear or move what is inside it.
Formula to use
=UNIQUE(B2:B9)The cells below must be empty for the result to spill
Merged cells and tables
If the spill range includes merged cells, you get #SPILL!. Unmerge them or move the formula.
Spilled results are not supported inside a table (one made with Ctrl+T). Move the formula outside the table, or convert the table to a normal range.
A whole-column reference that runs off the sheet
Putting a whole column such as A:A in VLOOKUP's lookup value returns 1,048,576 rows, which runs past the edge of the sheet. Reduce the lookup value to one cell or just the range you need.
=VLOOKUP(A2, A:C, 2, FALSE)Look up one cell and copy down=VLOOKUP(A2:A7, A:C, 2, FALSE)Only the range you need
When the result size keeps changing
If the size of the result depends on a function whose value changes on every calculation, such as RANDBETWEEN, the size cannot be fixed and you get #SPILL!.
=SEQUENCE(RANDBETWEEN(1, 1000))The size changes every time: #SPILL!
Try the functions used here
Change the arguments in the function playground and watch the calculation step by step.
- UNIQUE functionReturns the values (or rows) of a range with duplicates removed.
- FILTER functionReturns only the rows that meet a condition, spilled into several cells.
- SORT functionSorts a range by a chosen column and spills the result into several cells.
- SEQUENCE functionFills several cells with numbers that rise by a fixed step, like 1, 2, 3.
- VLOOKUP functionFinds a value in the first column of a table and returns a value from another column in the same row.
FAQ
- I only want part of the result.
- The formula lives only in the first cell, and the other cells just display the result. If you need part of it, pull it out with INDEX or narrow the reference.
- An old file now shows #SPILL!.
- A formula that used to return one cell may now try to spill into several and be blocked. Clear the cells it needs, or reduce the reference to one cell.