Unique Excel Ignore Blanks: A Practical Guide
Learn how to extract truly unique, non-blank values in Excel using dynamic arrays. This guide covers UNIQUE with FILTER, LET for readability, and practical examples to keep your data clean.

To extract truly unique, non-blank values in Excel, pair UNIQUE with FILTER to remove blanks, e.g. =UNIQUE(FILTER(A2:A100, A2:A100<>"")). For cleaner formulas, wrap with LET to reuse intermediate results, e.g. =LET(rng, A2:A100, UNIQUE(FILTER(rng, rng<>""))). This approach works in Excel 365 and Office 2021+ with dynamic arrays.
Understanding unique excel ignore blanks
In Excel, extracting unique values while ignoring blanks is a common data-cleaning task. The keyword here is the combination of dynamic array functions, especially UNIQUE and FILTER. When you build a list of distinct values from a broader dataset, blanks can creep in and distort counts or analyses. By explicitly filtering out empty cells before applying UNIQUE, you ensure your results reflect real, meaningful entries. This approach is especially powerful in datasets that get updated over time, because the dynamic array formulas automatically spill results as new data is added. According to XLS Library, embracing these functions early in your data pipeline reduces downstream cleanup work and improves reproducibility.
=UNIQUE(FILTER(A2:A100, A2:A100<>""))What this does:
- FILTER removes blank cells from A2:A100
- UNIQUE then returns the distinct, non-blank values
- The result spills into adjacent cells automatically
Another variant to handle stray spaces is to trim values first:
=UNIQUE(FILTER(TRIM(A2:A100), TRIM(A2:A100)<>""))Note: TRIM cleans leading/trailing spaces, but if a cell contains only spaces, TRIM will turn it into an empty string, which FILTER will discard.
text
Steps
Estimated time: 30-45 minutes
- 1
Prepare data
Identify the column or range containing the values you want to deduplicate and ensure there are no hidden blanks or non-printing characters. If needed, trim spaces to normalize data.
Tip: Use a quick data validation or a sample subset to validate behavior before applying to the full dataset. - 2
Apply a basic UNIQUE with FILTER
Enter a dynamic array formula that filters blanks first, then returns unique values. This serves as the baseline workflow for clean extraction.
Tip: Confirm spill range is clear to avoid #SPILL! errors. - 3
Add robustness with TRIM
Wrap the input in TRIM to remove incidental spaces that would otherwise create false duplicates or keep blanks.
Tip: Be mindful of non-breaking spaces; consider CLEAN if you suspect non-printing characters. - 4
Refactor with LET for readability
Use LET to assign the input range and a cleaned version, then apply UNIQUE to the named result. This makes the formula easier to read and reuse.
Tip: Avoid repeating long ranges; LET reduces recalculation cost in complex sheets. - 5
Extend to multi-column data
If you need unique rows based on multiple columns, apply a filter that requires all relevant columns to be non-blank, and pass the result to UNIQUE.
Tip: Check whether you want unique values or unique rows; the behavior differs by scope.
Prerequisites
Required
- Required
- Basic knowledge of Excel formulas (UNIQUE, FILTER, LET)Required
Optional
- Sample dataset to test on (A2:A100 or a similar range)Optional
- A keyboard with access to standard shortcutsOptional
Keyboard Shortcuts
| Action | Shortcut |
|---|---|
| CopyCopy selected cells or formula text | Ctrl+C |
| PastePaste into target range | Ctrl+V |
| Auto-Enter editing mode in a cellEdit the active cell without mouse | F2 |
| Fill downFill selected cells with the data above | Ctrl+D |
| Enter array formula (legacy)Legacy array entry in non-dynamic-array environments | Ctrl+⇧+↵ |
People Also Ask
What does UNIQUE(FILTER(range, range<>"")) do in Excel?
It first filters out blanks from the range, then returns the distinct non-blank values. The result spills into adjacent cells as a dynamic array.
It filters out blanks first, then lists each unique non-blank value automatically.
How can I ignore spaces and still get true unique values?
Wrap the range in TRIM (and optionally CLEAN) before filtering, so values with extra spaces don’t produce duplicates.
Trim spaces first, then deduplicate to get true unique values.
Can I apply this to multiple columns to get unique rows?
Yes. Use a multi-column FILTER condition and pass the resulting array to UNIQUE to return unique rows where all fields are non-blank.
Yes, filter on all relevant columns and then deduplicate the rows.
What if there are errors in the data?</
Wrap with IFERROR or LET with error handling to provide a clean result or a friendly message when data is missing.
Handle errors gracefully by using IFERROR around your formula.
What about older Excel versions?
Older versions may require legacy array formulas (Ctrl+Shift+Enter) or data tools like Advanced Filter to emulate similar behavior.
Older Excel versions may need legacy arrays or built-in filters to replicate this.
The Essentials
- Use UNIQUE with FILTER to ignore blanks
- TRIM helps remove incidental spaces
- LET improves readability and performance
- Test formulas on sample data before scaling