Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Google Sheets UNIQUE Ignore Blank: How-To Guide

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To get a unique list from a range while ignoring blank cells, wrap your range in a FILTER that removes blanks, then feed that result into UNIQUE. For example: =UNIQUE(FILTER(A2:A100, A2:A100<>"")). This returns each distinct non-blank value once, in the order it first appears. The rest of this guide explains why the simple UNIQUE formula leaves a zero or blank row, how to handle multiple columns, and what to do when the formula errors out.

What You'll Need

  • A Google account with access to Google Sheets (the free web version or the mobile app).
  • A spreadsheet containing a column or range with values and some empty cells.
  • Basic familiarity with typing formulas into a cell.

Step-by-Step

  1. Open your sheet and click an empty cell where you want the unique list to start. Make sure there is enough empty space below and to the right; UNIQUE spills results into neighbouring cells and will show a #REF! error if those cells are not empty.
  2. Type the basic UNIQUE formula first to see the problem. If your data is in A2:A100, enter =UNIQUE(A2:A100). Press Enter. You will likely see the distinct values plus a 0 at the bottom, because Sheets treats blank cells as zero in this context.
  3. Replace it with the FILTER-wrapped version. Edit the formula to =UNIQUE(FILTER(A2:A100, A2:A100<>"")). The FILTER part keeps only cells that are not empty (the <>"" means "not equal to empty text"), and UNIQUE then removes duplicates from that filtered list.
  4. Press Enter and check the result. You should see only the distinct non-blank values, with no trailing zero or blank row. The list updates automatically if you change the source data.
  5. For multiple columns, apply the same idea to the whole range. If your data is in A2:C100 and you want unique rows, use =UNIQUE(FILTER(A2:C100, A2:A100<>"")). This filters out rows where column A is blank, then returns unique combinations across all three columns. Adjust the filter column to whichever column must contain a value.
  6. To sort the result, wrap it in SORT. For example: =SORT(UNIQUE(FILTER(A2:A100, A2:A100<>""))). This gives you an alphabetical or numerical order without blanks.
  7. If you need a static list, copy and paste as values. Select the spilled results, copy, then use Paste special > Values only to replace the formula with fixed text. This is useful if you plan to delete the source data.

Note: menu labels and formula behaviour can differ slightly between the web version and the mobile app, and between regions. The formulas above work in both, but the mobile app may require you to tap the formula bar to edit.

Common Mistakes

  • Forgetting the FILTER wrapper. Using =UNIQUE(A2:A100) alone includes a 0 for blank cells. Always add the FILTER condition.
  • Filtering the wrong column. In a multi-column range, the condition A2:A100<>"" only checks column A. If blanks can appear in other columns, adjust the condition or use a helper column.
  • Not leaving enough spill space. UNIQUE and FILTER spill results downward. If any cell in the spill range contains data, you get a #REF! error. Clear the area first.
  • Using whole-column references like A:A inside FILTER. This can be slow and may include the header row. Use a bounded range such as A2:A1000.
  • Expecting UNIQUE to ignore blanks by itself. It does not; the FILTER step is required.

Tips

  • Use UNIQUE(FILTER(range, range<>"")) as a reusable pattern. Replace "range" with your actual range in both places.
  • If you want to count how many unique non-blank values exist, wrap the whole thing in COUNTA: =COUNTA(UNIQUE(FILTER(A2:A100, A2:A100<>""))).
  • For a unique list that ignores both blanks and errors, add IFERROR inside FILTER: =UNIQUE(FILTER(A2:A100, ISERROR(A2:A100)=FALSE, A2:A100<>"")) — but test carefully, as this also removes legitimate error values you might want to see.
  • Name your source range (Data > Named ranges) to make formulas easier to read and maintain.
  • If you are on the mobile app, you can still type these formulas; just tap the cell, then the formula bar, and enter the text.

Troubleshooting

  • #REF! error: The spill range is blocked. Clear the cells below and to the right of the formula, or move the formula to an empty area.
  • #N/A error: FILTER found no matching rows (all cells blank). Check that your range actually contains data and that the condition is correct.
  • Still seeing a 0: You may have used UNIQUE without FILTER, or the FILTER condition is not excluding blanks. Double-check the formula includes <>"".
  • Formula not updating: Ensure calculation is automatic (File > Settings > Calculation). Also check that the source range is correct.
  • Unexpected duplicates: UNIQUE treats values that look the same but differ in case or trailing spaces as different. Use TRIM and LOWER inside FILTER if needed: =UNIQUE(FILTER(TRIM(A2:A100), TRIM(A2:A100)<>"")).

Frequently Asked Questions

Can UNIQUE ignore blanks without FILTER?

No. UNIQUE alone returns a 0 for blank cells. You must combine it with FILTER or another function that removes blanks.

Why does my UNIQUE formula show a 0 at the end?

That 0 represents a blank cell in the source range. Wrap the range in FILTER with a not-empty condition to remove it.

Does this work in the Google Sheets mobile app?

Yes, the same formulas work in the mobile app, though editing long formulas is easier on a computer.

How do I get unique values from multiple columns ignoring blanks?

Use =UNIQUE(FILTER(A2:C100, A2:A100<>"")), adjusting the filter column to one that must have a value. This returns unique rows where that column is not blank.

Can I sort the unique list alphabetically?

Yes. Wrap the whole formula in SORT: =SORT(UNIQUE(FILTER(A2:A100, A2:A100<>""))).

What if I want to ignore blanks in a specific column only?

Adjust the FILTER condition to reference that column, for example =UNIQUE(FILTER(A2:C100, B2:B100<>"")) to require column B to be non-blank.