The #SPILL! error on a UNIQUE formula means the formula is trying to return multiple results, but something is blocking the cells where those results need to go. The fix is to clear the spill range: delete or move any data, merged cells, or objects sitting in the cells below or beside the formula, then press Enter again. If the range is clear, the formula spills normally. This guide walks through the causes, the fixes, and how to prevent the error.

What You'll Need

  • Excel for Microsoft 365, Excel 2021 or later, or Excel for the web (dynamic arrays are required for UNIQUE to spill).
  • The workbook open and the cell with the UNIQUE formula visible.
  • Permission to edit the sheet (a protected sheet can block changes).

Step-by-Step

  1. Select the cell with the #SPILL! error. Click the cell containing the UNIQUE formula. A thin blue border should appear around the range Excel is trying to fill. That border shows the spill range.
  2. Look for the blocking cell. Excel usually highlights the cell or range causing the block with a dashed border or a warning icon. Click the warning icon to see a message such as "Spill range isn't blank" or "Spill range has merged cells."
  3. Clear the blocking content. Select the highlighted cells and press Delete. If the cells contain data you need, cut and paste it to another location instead of deleting. Do not leave blank spaces or formatting that still counts as content.
  4. Check for merged cells. Select the spill range and look at the Merge & Center button on the Home tab. If it is active, click it to unmerge the cells. Merged cells cannot be part of a spill range.
  5. Remove any objects in the way. Pictures, shapes, charts, or text boxes that overlap the spill range can block it. Move them outside the range or delete them.
  6. Press Enter to recalculate. After clearing the blockage, click the formula cell and press Enter. The formula should now spill and fill the range with unique values.
  7. If the formula still spills into unwanted cells, consider wrapping it in a function that limits the output, such as INDEX, or move the formula to a location with enough empty space below and to the right.

Common Mistakes

  • Deleting only the visible value. A cell may look empty but contain a space, an apostrophe, or formatting that still blocks the spill. Use Ctrl+End or select the range and check the formula bar.
  • Forgetting merged cells. Merged cells are a frequent cause and are easy to miss because they look like normal cells until you select them.
  • Placing the formula too close to other data. UNIQUE needs empty cells below and to the right for its results. If the sheet is crowded, move the formula or use a smaller range.
  • Using an older Excel version. Dynamic arrays and UNIQUE are not available in Excel 2019 or earlier. In those versions, the formula returns #NAME? or a similar error, not #SPILL!.
  • Ignoring table boundaries. If the formula is inside an Excel Table, it may not spill outside the table. Place the formula outside the table or convert the table to a range.

Tips

  • Use the spill range operator (#) to refer to the entire spilled range in other formulas, for example =COUNTA(A2#).
  • Keep a few empty rows and columns around formulas that spill so they have room to grow.
  • If you need to prevent spilling, enter the formula as a legacy array formula with Ctrl+Shift+Enter, but this is rarely necessary with UNIQUE.
  • Check the status bar: when you select a spill range, Excel shows the count of cells in the range.
  • Use Excel's Error Checking options (Formulas tab > Error Checking) to get more detail on the #SPILL! error.

Troubleshooting

If the #SPILL! error persists after clearing the obvious blockers, try these steps in order:

  1. Check for hidden rows or columns. Unhide all rows and columns in the spill range (select the range, right-click, choose Unhide).
  2. Look for data validation or conditional formatting that might be applied to the spill range. These usually do not block spilling, but they can cause confusion. Clear formatting from the range and reapply if needed.
  3. Verify the formula is not inside a table. Tables have their own rules; move the formula outside the table.
  4. Check sheet protection. If the sheet is protected, unprotect it (Review tab > Unprotect Sheet) before editing.
  5. Restart Excel. Save your work, close Excel, and reopen the workbook. This clears temporary glitches.
  6. Test in a new sheet. Copy the formula to a blank sheet. If it works there, the original sheet has a blockage you have not found yet.

If none of these work, the formula itself may be returning an array that is too large for the available space. Reduce the range in the UNIQUE formula or move it to a location with more empty cells.

Frequently Asked Questions

Why does UNIQUE return #SPILL! instead of a list?

UNIQUE is a dynamic array function. It tries to output all unique values at once. If any cell in the output area is not empty, Excel cannot place the results and shows #SPILL!.

Can I stop a formula from spilling?

You can use the @ operator (implicit intersection) to force a single value, for example =@UNIQUE(A1:A10). This returns only the first result and avoids spilling, but you lose the full list.

Does #SPILL! mean my formula is wrong?

No. The formula logic is usually correct; the error is about space. Fix the blockage and the formula works.

Why does the spill range border not appear?

The border appears only when the formula is selected and the spill range is valid. If there is an error, the border may not show. Check the formula and the surrounding cells.

Can I use UNIQUE in Excel 2019?

No. UNIQUE and dynamic arrays are available only in Excel for Microsoft 365, Excel 2021, and later versions, plus Excel for the web. In older versions, use a workaround with INDEX/MATCH or remove duplicates manually.