Excel Unique Ignore Blanks: How to Filter Out Empty Cells
In this article
To get a unique list while ignoring blanks in Excel, the most efficient method is to wrap the UNIQUE function inside a FILTER function. Use the formula =UNIQUE(FILTER(A2:A100, A2:A100<>"")). This tells Excel to first remove all empty cells from the range and then extract only the distinct values from the remaining data, preventing a zero or a blank entry from appearing in your final list.
What You'll Need
- A version of Excel that supports Dynamic Arrays (Microsoft 365, Excel 2021, or Excel for the Web).
- A dataset containing a column of information with duplicate entries and empty cells.
- Basic familiarity with entering formulas into a cell.
Step-by-Step
- Identify Your Data Range: Locate the column containing the values you want to deduplicate. For this example, assume your data is in cells A2 through A100.
- Select the Destination Cell: Click on the empty cell where you want the unique, non-blank list to begin. Ensure there is enough empty space below this cell, as the result will "spill" downward automatically.
- Start the FILTER Function: Type
=FILTER(. The FILTER function is necessary because the UNIQUE function considers a blank cell as a valid value and will include it (often as a 0) in the results. - Define the Array: Enter the range of your data. Following our example, type
A2:A100. Now your formula looks like=FILTER(A2:A100,. - Set the Inclusion Criteria: After the comma, enter the same range again followed by the "not equal to" operator and empty quotes. Type
A2:A100<>"". This tells Excel to only keep cells that are not empty. - Close the FILTER Function: Type a closing parenthesis
). If you press Enter now, you will have a list of all values minus the blanks, but duplicates will still remain. - Wrap with the UNIQUE Function: Move your cursor to the beginning of the formula and type
=UNIQUE(before the FILTER part. Then, add a final closing parenthesis at the very end. Your complete formula should now be:=UNIQUE(FILTER(A2:A100, A2:A100<>"")). - Execute and Verify: Press Enter. Excel will generate a dynamic list that automatically updates if you change the source data or add new unique entries.
- Optional: Sort the Results: If you want the unique list in alphabetical or numerical order, wrap the entire formula in the SORT function:
=SORT(UNIQUE(FILTER(A2:A100, A2:A100<>""))).
Common Mistakes
One of the most frequent errors is using the UNIQUE function alone. When you use =UNIQUE(A2:A100) on a range that contains empty cells, Excel treats the blank as a distinct value. Depending on the cell formatting, this usually results in a "0" appearing at the bottom of your list. Users often try to delete this zero manually, but because the formula is dynamic, the zero will reappear whenever the sheet recalculates.
Another common mistake is failing to provide enough "spill room." Because these functions create a dynamic array, they require empty cells below and to the right of the formula cell. If there is any existing text or data in the path of the results, Excel will return a #SPILL! error. This doesn't mean the formula is wrong; it simply means the output is being blocked by other data.
Some users mistakenly use =UNIQUE(FILTER(A2:A100, A2:A100="")). By using the equals sign instead of the not-equal-to sign (<>), you are telling Excel to filter for only the blanks, which results in a list containing a single blank entry—the exact opposite of the desired outcome.
Tips
To make your formulas more resilient, convert your source data into an official Excel Table (Ctrl+T). Instead of using fixed ranges like A2:A100, you can use structured references such as =UNIQUE(FILTER(Table1[ColumnName], Table1[ColumnName]<>"")). The benefit of this approach is that as you add new rows to the bottom of your table, the unique list will update automatically without you having to manually adjust the range in the formula.
If you are dealing with a massive dataset where performance becomes an issue, consider using the "Remove Duplicates" tool under the Data tab. While this is a static process and won't update automatically, it is computationally lighter than complex array formulas. To ignore blanks using this method, first apply a filter to the column, uncheck "Blanks," copy the visible cells to a new location, and then apply the Remove Duplicates tool to that new list.
For those who need the unique list to be used in a Data Validation dropdown menu, remember that you cannot put a spill formula directly into the Data Validation source box. Instead, place the formula in a hidden helper column and then set the Data Validation source to the first cell of the spill range followed by a hashtag (e.g., =$G$2#). The hashtag tells Excel to include the entire dynamic array regardless of how long it grows.
Troubleshooting
If your formula returns a #CALC! error, it usually means the FILTER function found nothing that matched your criteria. In the context of ignoring blanks, this happens if every single cell in your selected range is empty. To prevent this error from appearing to end-users, you can wrap the formula in IFERROR: =IFERROR(UNIQUE(FILTER(A2:A100, A2:A100<>"")), "No data found").
If the formula is returning a #NAME? error, you are likely using a version of Excel that does not support the UNIQUE or FILTER functions. These are exclusive to Microsoft 365 and newer versions. If you are on an older version like Excel 2016 or 2019, you will need to use a much more complex array formula involving INDEX, MATCH, and COUNTIF, or use the Power Query tool (Data > Get Data) to remove duplicates and filter out nulls.
If you see a #SPILL! error, look at the cells below your formula. Even a single space character in a cell that looks empty can block the spill range. Highlight the area below the formula and press the Delete key to ensure the range is truly empty, and the error should disappear instantly.
Frequently Asked Questions
Why does UNIQUE return a 0 for blank cells?
Excel treats an empty cell in a range as a null value. When the UNIQUE function processes this, it identifies the null as a unique entry and converts it to a zero to represent that empty state in the resulting array.
Can I ignore blanks across multiple columns?
Yes, but the FILTER criteria must be adjusted. You can use the addition operator (+) within the FILTER function to act as an "OR" statement, ensuring that a row is only included if at least one of the specified columns is not blank.
Does this method work for numbers and text?
Yes, the <>"" criteria works for both text strings and numerical values. It simply checks if the cell is empty regardless of the data type contained within it.
Will this update if I add new data to the list?
If you used a fixed range (like A2:A100), it will only update if you add data within those specific cells. If you used an Excel Table reference, the list will update automatically as new rows are added to the table.
Is there a way to do this without formulas?
Yes, you can use Power Query. Go to the Data tab, select From Table/Range, click the filter arrow on the column header to uncheck "Null," then right-click the column header and select Remove Duplicates before loading the data back into the sheet.