Google Sheets UNIQUE Without Blanks: Step-by-Step Guide
In this article
To get a list of unique values from a range in Google Sheets without any blank cells, wrap your data range in a FILTER function that removes empty cells, then feed the filtered range into UNIQUE. For example, if your data is in A2:A100, use =UNIQUE(FILTER(A2:A100, A2:A100 <> "")). This returns only distinct non-blank entries, in the order they first appear. The steps below show how to apply this for a single column, multiple columns, and how to handle common issues like extra spaces and error values.
What You'll Need
- A Google account with access to Google Sheets (free).
- A spreadsheet containing the data you want to deduplicate. The data can be in a single column or multiple columns.
- Basic familiarity with entering formulas in a cell (typing an equals sign and pressing Enter).
Step-by-Step
- Open your spreadsheet and identify the range that contains the values you want to list uniquely. For this guide, we'll assume your data is in column A, starting at A2 and going down to A100. Adjust the range to match your actual data.
- Select an empty cell where you want the unique list to appear. Make sure there is enough empty space below and to the right of that cell, because the formula will spill results into neighbouring cells.
- Enter the basic UNIQUE formula without blanks. Type the following formula (replace A2:A100 with your actual range):
=UNIQUE(FILTER(A2:A100, A2:A100 <> ""))
Press Enter. The cell will now show the first unique non-blank value, and the rest will spill down automatically. - Check the result. You should see a list of distinct values with no empty rows. If you see a #N/A error, it means the FILTER found no non-blank values (your range might be entirely empty). If you see a #REF! error, there isn't enough empty space for the results to spill into—clear some cells below.
- For multiple columns, use the same pattern but apply FILTER to the entire range. For example, if your data is in A2:C100 and you want unique rows (combinations of values across columns), use:
=UNIQUE(FILTER(A2:C100, A2:A100 <> ""))
This filters out rows where column A is blank, then returns unique rows. Adjust the condition to match the column that should never be blank. - Handle extra spaces. If your data contains values that look identical but have trailing or leading spaces, UNIQUE will treat them as different. To avoid this, wrap the range in TRIM inside FILTER:
=UNIQUE(FILTER(TRIM(A2:A100), TRIM(A2:A100) <> ""))
This removes extra spaces and also excludes cells that become empty after trimming. - Ignore error values. If your range contains errors like #N/A, you can exclude them by adding a condition to FILTER. For example, to ignore both blanks and #N/A errors:
=UNIQUE(FILTER(A2:A100, (A2:A100 <> "") * ISNA(A2:A100)))
Note: this uses multiplication to combine conditions (AND logic). You can adapt it for other error types using ISERROR, but be careful—ISERROR will also catch other errors you might want to keep. - Sort the unique list (optional). To sort the result alphabetically, wrap the entire formula in SORT:
=SORT(UNIQUE(FILTER(A2:A100, A2:A100 <> "")))
This gives you a clean, sorted list of unique non-blank values. - Copy the formula down or across if needed. The UNIQUE function spills automatically, so you only need to enter it once. If you want to use the same logic for another column, enter a similar formula in a different cell.
Common Mistakes
- Forgetting to adjust the range. Using a fixed range like A2:A100 when your data extends to A200 will miss values. Use a larger range or an open-ended range like A2:A (which includes all rows below).
- Not leaving enough space for spill results. If there are existing values in the cells where the unique list would spill, you'll get a #REF! error. Clear the area or move the formula.
- Using UNIQUE alone without FILTER. UNIQUE by itself includes a blank cell if the range contains blanks. Always combine with FILTER to remove blanks.
- Ignoring whitespace. Values that differ only by spaces are treated as distinct. Use TRIM to normalise.
- Assuming FILTER works with closed ranges only. FILTER can handle open-ended ranges like A2:A, but be aware that it will process all rows, which might slow down very large sheets.
Tips
- Use open-ended ranges (e.g., A2:A) to automatically include new data as you add rows. The formula will update dynamically.
- If you need to count unique values instead of listing them, use
=COUNTUNIQUE(FILTER(A2:A100, A2:A100 <> ""))or=COUNTA(UNIQUE(FILTER(A2:A100, A2:A100 <> ""))). - To make the formula more readable, define a named range for your data (Data > Named ranges) and use that name in the formula.
- Combine with SORT and SORTN for more control, e.g., to get the top N unique values.
- Remember that UNIQUE is case-sensitive: "Apple" and "apple" are considered different. Use LOWER or UPPER inside FILTER if you need case-insensitive uniqueness.
Troubleshooting
- #N/A error: FILTER found no non-blank values. Check that your range actually contains data and that the condition is correct (e.g., A2:A100 <> "").
- #REF! error: Not enough empty space for the results to spill. Clear cells below and to the right of the formula cell.
- Blank cells still appear: Ensure your FILTER condition is correctly excluding blanks. If your data contains cells with formulas that return empty strings (""), they are not truly blank and won't be filtered by <> "". Use
FILTER(A2:A100, LEN(A2:A100)>0)to exclude empty strings as well. - Formula not updating: Check that calculation is set to automatic (File > Settings > Calculation). Also, ensure the range is correct and not referencing a different sheet incorrectly.
- Performance issues: Large ranges with complex FILTER conditions can slow down your sheet. Consider limiting the range to the actual data size or using ARRAYFORMULA with IF to reduce load.
Frequently Asked Questions
Can I use UNIQUE without FILTER to ignore blanks?
No, UNIQUE alone will include a blank cell if the range contains blanks. You must combine it with FILTER or another function to exclude blanks.
Does UNIQUE work with multiple columns?
Yes, UNIQUE can take a range with multiple columns and returns unique rows. To ignore blanks, apply FILTER to the entire range with a condition on one column.
How do I remove blanks from a list that already has unique values?
If you already have a list with blanks, you can use =FILTER(A2:A100, A2:A100 <> "") to remove blanks, then wrap with UNIQUE if needed.
Why does my UNIQUE formula return duplicates?
UNIQUE treats values as duplicates only if they are exactly identical, including case and spaces. Use TRIM and LOWER/UPPER to normalise if needed.
Can I use this formula across multiple sheets?
Yes, you can reference ranges from other sheets, e.g., =UNIQUE(FILTER(Sheet2!A2:A100, Sheet2!A2:A100 <> "")). Just ensure the sheet name is correct.
Is there a limit to the number of unique values UNIQUE can return?
Google Sheets has a limit of 10 million cells per spreadsheet, but UNIQUE itself doesn't have a specific limit. Performance may degrade with very large datasets.