Excel UNIQUE Function Spill Error in Tables: Fix It
In this article
The UNIQUE function cannot spill inside an Excel Table (a ListObject). If you type =UNIQUE(Table1[Column1]) into a table column, Excel returns #SPILL! because a calculated column must return exactly one value per row, and UNIQUE returns a dynamic array that needs room to spill. The fix is to move the formula outside the table into a normal cell range, or replace it with a non-spilling alternative such as INDEX/MATCH, COUNTIF, or Power Query. This guide shows the exact steps, why the error happens, and the cleanest workarounds.
What You'll Need
- Excel for Microsoft 365, Excel 2021, or Excel 2024 (UNIQUE and dynamic arrays are not available in Excel 2019 or earlier).
- A worksheet that already contains an Excel Table (select the data and press Ctrl+T, or use Insert > Table).
- An empty area of cells below or beside the table, large enough to hold the spilled results.
Step-by-Step
- Confirm the error is #SPILL! and not #NAME?. Click the cell with the formula. If the error is #SPILL!, the formula is correct but the destination is blocked. If it is #NAME?, your Excel version does not support UNIQUE — check File > Account > About Excel and update to Microsoft 365 or a 2021/2024 perpetual version.
- Identify the table. Click any cell inside the data. If the Table Design tab appears on the ribbon, the range is a Table. UNIQUE cannot spill inside a Table because every table column must return one value per row.
- Move the formula outside the table. Click an empty cell below the table (for example, two rows beneath the last data row) and enter
=UNIQUE(Table1[Column1]), replacing Table1 and Column1 with your actual table and column names. Press Enter. The unique values spill down automatically. - Clear the blocked cells. If you still see #SPILL!, the spill range is obstructed. Click the error, then click the warning icon and choose Select Obstructing Cells. Delete or move whatever is in those cells (text, merged cells, or another formula), and the spill will fill.
- Do not place the formula in a merged cell. Merged cells cannot host a spill. Unmerge the cell (Home > Merge & Center) and re-enter the formula.
- If you need the result inside the table, use a non-spilling formula instead. In a table column, enter
=IF(COUNTIF($A$2:A2,[@Column1])=1,[@Column1],"")to flag the first occurrence of each value. This returns one value per row and does not spill. - Or use Power Query for a clean unique list. Select the table, then Data > From Table/Range. In Power Query, right-click the column header and choose Remove Duplicates, then Home > Close & Load. The result loads to a new worksheet as a static unique list.
- Convert the table to a range only if you truly do not need table features. Right-click the table, choose Table > Convert to Range, then enter the UNIQUE formula. Note that you lose structured references, banded rows, and automatic expansion.
Common Mistakes
- Assuming UNIQUE works in every Excel version. It is a dynamic array function and does not exist in Excel 2016, 2019, or older. Those versions return #NAME?.
- Typing UNIQUE into a table column and expecting it to spill. A table column is a calculated column and must return one value per row; a spill of multiple values triggers #SPILL!.
- Leaving text or merged cells in the spill range. Even a single space character blocks the spill and produces #SPILL!.
- Using a whole-column reference inside a table. References like
UNIQUE(A:A)inside a table column compound the spill problem and slow the workbook. - Forgetting that the spill range grows. If you later type in the cells below a spilled UNIQUE formula, you overwrite the spill and get #SPILL! again.
Tips
- Use structured references such as
Table1[Column1]so the UNIQUE formula updates automatically when rows are added to the table. - Place the UNIQUE formula in a cell with several empty rows beneath it so the spill has room to expand.
- Combine UNIQUE with SORT and FILTER, for example
=SORT(UNIQUE(FILTER(Table1[Column1],Table1[Column1]<>""))), to produce a clean sorted list outside the table. - If you need the unique list to stay inside the table structure, Power Query is the most robust option because it refreshes on demand and does not spill.
- Press Ctrl+Shift+Enter only in legacy Excel; in Microsoft 365, Enter is enough and legacy array entry is not needed.
Troubleshooting
If the formula still shows #SPILL! after moving it outside the table, click the error and choose Select Obstructing Cells to see exactly what is blocking the spill. Delete or relocate those cells. If the error is #NAME?, update Excel to Microsoft 365 or a 2021/2024 version; UNIQUE is not available in older releases. If the formula returns only one value when you expect several, check that the source column actually contains duplicates and that you have not wrapped the formula in a function that forces a single result. If the workbook is shared and the spill range was overwritten by a colleague, re-enter the formula in an empty area. If you converted the table to a range and lost formatting, undo with Ctrl+Z and use the Power Query method instead. Finally, if the formula references a table on another sheet, confirm the table name is spelled exactly as shown in Table Design > Table Name.
Frequently Asked Questions
Why does UNIQUE give #SPILL! inside an Excel Table?
Because a table column is a calculated column that must return exactly one value per row, while UNIQUE returns a dynamic array of multiple values. Excel cannot spill an array inside a table, so it returns #SPILL!.
Can I use UNIQUE in a table at all?
No. UNIQUE is a dynamic array function and cannot spill inside a Table object. Use it in a normal cell range outside the table, or use COUNTIF, INDEX/MATCH, or Power Query inside the table.
What Excel versions support UNIQUE?
Excel for Microsoft 365, Excel 2021, and Excel 2024 support UNIQUE. Excel 2019 and earlier do not and return #NAME?.
How do I remove duplicates inside a table without UNIQUE?
Use Data > From Table/Range to open Power Query, right-click the column and choose Remove Duplicates, then Close & Load. Alternatively, use a COUNTIF formula in a helper column to flag first occurrences.
Why does UNIQUE return #SPILL! even outside a table?
The spill range is blocked by existing content, merged cells, or another formula. Click the error, choose Select Obstructing Cells, and clear them.
Does converting the table to a range fix the spill error?
Yes, but you lose table features such as structured references and automatic expansion. Prefer moving the formula outside the table or using Power Query instead.