How to Use the FILTER and UNIQUE Functions in Excel to Build Dynamic Lists

Help Desk Geek Staff · Edited by Aseem Kishore
13 min read

Help Desk Geek is reader-supported. We may earn a commission when you buy through links on our site. Learn more.

Need a separate Excel list that follows changes to a source table? FILTER and UNIQUE can filter or de-duplicate that table and recalculate when its data changes, subject to calculation settings and a clear spill range. You need Excel for Microsoft 365, Excel 2024, Excel 2021, or Excel for the web. You type one formula in a single cell, and the results spill into the cells below it. See also our guide on Excel ENTITY and Dot Functions Enter Preview: What Changes.

Excel FILTER and UNIQUE Functions: Quick Reference

What you wantFormula patternSection
Rows matching one condition=FILTER(Sales,Sales[Region]=H1,"No matches")Single condition
Rows matching two conditions (AND)=FILTER(Sales,(Sales[Region]=H1)*(Sales[Product]=H2),"No matches")Multiple criteria
Rows matching either condition (OR)=FILTER(Sales,(Sales[Region]="East")+(Sales[Region]="West"),"No matches")Multiple criteria
A list with no duplicates=UNIQUE(Sales[Rep])UNIQUE
Values that appear only once=UNIQUE(Sales[Rep],,TRUE)UNIQUE
A sorted, filtered dropdown source=SORT(UNIQUE(FILTER(Sales[Rep],Sales[Region]=H1,"No matches")))Dropdown
#CALC! when nothing matchesAdd the third if_empty argumentFix #2
#SPILL!Clear the cells below or to the right of the formulaFix #3

Check That Your Excel Version Supports FILTER and UNIQUE

FILTER and UNIQUE are built-in formulas, so there’s nothing to install. Microsoft lists them as available in Excel for Microsoft 365, Excel 2024, Excel 2021, and Excel for the web (FILTER function, UNIQUE function).

Older perpetual versions such as Excel 2016 and Excel 2019 lack these dynamic-array functions; do not assume installing ordinary updates adds them (Microsoft Q&A). If you’re unsure which track you’re on, check your version before troubleshooting further.

Microsoft’s current FILTER and UNIQUE pages document Microsoft 365, Excel 2021, Excel 2024 and web editions, not Excel 2019. This tutorial follows that documented product scope; confirm function availability in your actual product/build and update channel. Its Excel 2021 release notes identify these as new dynamic-array functions. Check the actual product and function support rather than assuming an older license gains them through updates.

On Windows

  • Open Excel.
  • Click File > Account.
  • Read the product name under Product Information. You want Microsoft 365, Excel 2024, Excel 2021.
Excel Account page identifying a Microsoft 365 subscription

On macOS

  • Open Excel for Mac.
  • Click Excel > About Excel in the menu bar.
  • Confirm the dialog shows a Microsoft 365, Excel 2024, Excel 2021 build. Older standalone Mac versions don’t include these functions.
About Excel for Mac dialog identifying a Microsoft 365 subscription

On the web

  • Open Excel for the web and sign in with your Microsoft account.
  • Open or create a workbook. FILTER and UNIQUE work there without a separate download.
Excel for the web workbook with the tutorial Sales table and dynamic-array formulas

If your licensed edition lacks these functions, use an available supported version or another suitable filtering method. Excel for the web may be an option with a Microsoft account; check your account and organizational requirements before uploading a workbook.

Do not buy a new license solely because one formula fails. First check its spelling, the product’s supported functions and any workbook compatibility requirements.

Set Up the Sample Sales Table

Every formula here uses the same table, so you can paste them as-is. Format your data as an Excel Table first.

Structured references are designed to adjust as the source table grows or shrinks. Put the spilled output formula in an ordinary range outside the Excel Table: dynamic-array formulas do not spill within a table. Leave enough unobstructed cells for the result and use automatic calculation when expecting live updates.

  • Enter this data starting in cell A1 (add more rows as you like, down to row 21):
DateRepRegionProductAmount
1/6/2026DanaEastLaptop1200
1/7/2026MarcoWestMonitor300
1/9/2026DanaEastMonitor280
1/12/2026PriyaNorthLaptop1150
1/14/2026MarcoEastLaptop1250
1/15/2026LeeWestDocking station220
  • Click any cell inside the data.
  • Press Ctrl + T (or go to Insert > Table), confirm My table has headers is checked, and click OK.
  • On the Table Design tab, change Table Name to Sales and press Enter.
  • Type East in cell H1 and Laptop in cell H2. These are your criteria cells.

Expected result: the data shows banded table formatting, and typing =Sales[ in any cell brings up a list of the column names. If that list doesn’t appear, the table name didn’t save.

How to Use the FILTER Function with a Single Condition

FILTER’s syntax is =FILTER(array, include, [if_empty]) ([Microsoft Support]). array is the data to return. include is a TRUE/FALSE test the same height as the array. if_empty is optional text to show when nothing matches.

  • Click cell G4. Make sure the cells below and to the right of it are empty.
  • Type this formula:
=FILTER(Sales,Sales[Region]=H1,"No matches")
  • Press Enter (or Return on a Mac).
FILTER formula returning East-region rows from the Sales table

Expected result: matching East rows fill adjacent cells from G4. The spill indicator’s appearance depends on Excel version, theme and selection. Only G4 holds the formula. The other cells are generated results, so click G4 whenever you want to edit it.

East-region FILTER results spilling beside the source Sales table
  • Change H1 to West.

Expected result: with automatic calculation enabled and an unobstructed spill range, the output recalculates for West. Add a new East row to the Sales table, switch the criterion back to East and confirm the new row appears; check calculation mode if it does not.

To return a single column, point array at that column. =FILTER(Sales[Rep],Sales[Region]=H1,"No matches") lists only rep names.

Filter by Multiple Criteria with AND (*) and OR (+)

FILTER has no separate AND/OR arguments. Instead, you multiply or add the TRUE/FALSE tests. Excel treats TRUE as 1 and FALSE as 0, so the math decides which rows survive.

AND: both conditions must match

Multiplying is a common technique for combining tests in FILTER.

It returns 1 only when both tests are TRUE, and 0 otherwise.

  • Click G4 and replace the formula with:
=FILTER(Sales,(Sales[Region]=H1)*(Sales[Product]=H2),"No matches")
  • Press Enter.
FILTER formula applying East-region and Laptop criteria together

Expected result: with H1 = East and H2 = Laptop, you get only East laptop sales. Wrap each test in its own parentheses. Without them, Excel evaluates the operators in the wrong order.

OR: either condition can match

Adding is a common technique for combining tests with OR logic.

The result is 1 or more when at least one test is TRUE.

=FILTER(Sales,(Sales[Region]="East")+(Sales[Region]="West"),"No matches")

Expected result: East and West rows appear, North rows don’t. You can mix both operators. =FILTER(Sales,((Sales[Region]="East")+(Sales[Region]="West"))*(Sales[Amount]>500),"No matches") returns East or West sales over 500.

Use UNIQUE to Build Distinct Lists and Counts

UNIQUE’s syntax is =UNIQUE(array, [by_col], [exactly_once]) ([Microsoft Support]). by_col defaults to FALSE, which compares rows. exactly_once defaults to FALSE, which returns every distinct value.

Get a list with no duplicates

  • Click an empty cell with room below it, such as M4.
  • Type:
=UNIQUE(Sales[Rep])
  • Press Enter.
UNIQUE formula returning the distinct Sales table rep names

Expected result: each rep appears once, in the order they first show up in the table.

Find values that appear exactly once

Set the third argument to TRUE and leave the second one empty.

Per UNIQUE’s exactly_once argument, this returns only values that appear a single time in the source range:

=UNIQUE(Sales[Rep],,TRUE)

Expected result: only reps with a single sale in the table appear. In the sample data, that’s Priya and Lee. This is handy for spotting reps who appear only once in this sample.

Count distinct values

Wrap UNIQUE in COUNTA to count the distinct entries.

COUNTA counts the non-blank items in a range, so applied to UNIQUE’s output it returns the number of distinct reps:

=COUNTA(UNIQUE(Sales[Rep]))

Expected result: a single number. With the six sample rows in this example, it returns 4.

Remove duplicates from FILTER results

FILTER returns every matching row, repeats included. Wrap it in UNIQUE when you want each value once:

=UNIQUE(FILTER(Sales[Rep],Sales[Region]=H1,"No matches"))

Combine SORT, UNIQUE, and FILTER for a Dynamic Dropdown

A Data Validation dropdown pointed at a static list goes stale every time someone adds a row.

In Excel versions that support dynamic arrays, you can point Data Validation at a spilled formula instead, and the choices stay current.

  • Click cell O2 (any empty column works).
  • Type this helper formula and press Enter:
=SORT(UNIQUE(FILTER(Sales[Rep],Sales[Region]=H1,"No matches")))

Expected result: an alphabetical, duplicate-free list of reps who sold in the region typed in H1.

  • Click cell H3, where the dropdown will live.
  • Go to Data > Data Validation (in the Data Tools group).
  • On the Settings tab, set Allow to List.
  • In Source, type =$O$2# and click OK.

The # after the cell address refers to the spilled range from that formula.

If your Excel version accepts the spill reference, the validation source can follow that range. If it rejects =$O$2#, try a workbook-level defined name referring to the helper spill and use that name as the validation source. If unsupported in your version, use a maintained ordinary range instead; verify the dropdown after changing the source.

Data Validation list source referencing the dynamic helper spill at O2
  • Click the arrow next to H3.
Dropdown list populated from sorted unique East-region rep names

Expected result: the dropdown lists exactly the names in O2#. Change H1 to another region, reopen the dropdown, and the choices change with it. That’s your verification that the dropdown reads the live spill and not a frozen copy.

Fix #1: Check the Function Name and Version to Clear #NAME?

#NAME? means Excel doesn’t recognize the function. That’s usually one of a few causes, and they’re easy to tell apart.

  • Click the error cell and read the formula bar. Look for typos like FILTR or UNIQE.
  • Retype the function name. As you type =FIL, Excel should offer FILTER in the autocomplete list.
  • If FILTER or UNIQUE never appears in autocomplete, check your version under File > Account.

Diagnostic signal: a missing autocomplete suggestion can indicate unsupported functions, but also check spelling, localization, input context and autocomplete behavior before drawing that conclusion. That can occur in an older perpetual edition such as Excel 2016 or Excel 2019; updates do not generally add these newer functions to an older license. Open the file in Excel for the web, or update or switch to a supported version.

Fix #2: Add an if_empty Argument to Clear #CALC!

#CALC! appears when FILTER finds zero matching rows and you didn’t supply the third argument. Excel can’t display an empty array, so it shows an error instead ([Microsoft Support]).

FILTER without an empty-result argument showing a CALC error for a missing region
  • Click the formula cell.
  • Add a third argument before the closing parenthesis:
=FILTER(Sales,Sales[Region]=H1,"No matches")
  • Press Enter.

Diagnostic signal: if the cell now reads “No matches,” the formula works and the data simply has no matching rows. If you expected matches, check H1 for a typo or a trailing space.

Fix #3: Clear the Spill Path to Fix #SPILL!

#SPILL! means something sits in the cells where the results need to go. Excel won’t overwrite existing data.

Excel SPILL error with existing content obstructing the output range
  • Click the error cell. A dashed border shows where the results want to go.
  • Find any cell inside that border holding a value, a space, or a formula.
  • Select those cells and press Delete to clear their contents. Clearing formatting alone won’t help.
  • If you can’t clear the area, cut the formula and paste it somewhere with more empty space.

Diagnostic signal: the error disappears the moment the last blocker is cleared, without re-entering the formula. If it doesn’t, a cell probably holds an invisible space. Select the whole range and press Delete again.

Fix #4: Exclude Empty Source Rows to Remove Blank Results

If the returned Rep values are blank, add a not-blank test for that column with AND. Blank output can have other causes, including intentionally blank return values or other formula logic; this example addresses blank Rep cells specifically.

=FILTER(Sales[Rep],(Sales[Region]=H1)*(Sales[Rep]<>""),"No matches")
  • Click the formula cell.
  • Replace the formula with the version above.
  • Press Enter.

Diagnostic signal: the blank lines vanish while real results stay put.

Fix #5: Keep Both Workbooks Open for Cross-Workbook Formulas

A FILTER or UNIQUE formula pointing at another workbook can show #REF! or stop updating. Dynamic arrays have limited support across workbooks, so both files need to be open.

  • Open the source workbook.
  • Open the workbook containing the formula.
  • Press F9 to recalculate.

If you share the file often, copy the source data into the same workbook instead. That removes the dependency entirely.

FILTER vs AutoFilter vs PivotTable: When to Use Which

All four tools narrow data down, but they behave differently once the data changes.

ToolWhat it doesUpdates when data changes?Best for
FILTER/UNIQUEBuilds a separate, live list from a formulaYes, instantlyReport lists, dropdown sources, de-duplicated lists
AutoFilter (Data > Filter)Hides non-matching rows in the original tableCriteria remain applied; changed data may require reapplying the filterQuick filtering within the source
PivotTable (Insert > PivotTable)Sums, counts, and averages by categoryNo, needs a refreshTotals and summaries
Advanced Filter (Data > Advanced)Copies matching rows to a new spot onceNo, you re-run itLegacy workbooks
Excel ribbon controls for AutoFilter and PivotTable

My pick: use FILTER/UNIQUE whenever the output is a list of rows or names that should stay current. Use a PivotTable when you need totals by region or product. The PivotTable guide linked in this section covers that workflow. AutoFilter is fine for a quick look, but I’d skip it for anything you’ll reuse.

Help & Answers

FAQ

6 questions

What do FILTER and UNIQUE do differently from AutoFilter?

AutoFilter hides rows inside your original table. FILTER and UNIQUE write a separate list somewhere else and recalculate whenever the source changes.

Which versions of Excel support FILTER and UNIQUE?

Excel for Microsoft 365 (Windows and Mac), Excel 2024, Excel 2021, and Excel for the web all support them, per Microsoft’s documentation.

Older perpetual editions such as Excel 2016 and Excel 2019 do not provide these dynamic-array functions. Check spelling and supported-function documentation before choosing a different edition or workflow.

How do I filter by more than one condition?

Multiply conditions for AND: (test1)*(test2). Add them for OR: (test1)+(test2). Put each test in its own parentheses.

How do I get a list with no duplicates?

Use =UNIQUE(Sales[Rep]). To de-duplicate filtered results, wrap FILTER inside UNIQUE.

How do I make a dropdown list that updates automatically?

Put a SORT(UNIQUE(FILTER())) formula in a helper cell. Then set the Data Validation Source to that cell plus #, such as =$O$2#.

Can I edit one cell in a spilled result?

No. Only the top-left cell holds the formula. Edit that cell, and the whole spill updates.

Wrapping Up

For most report lists, =UNIQUE(FILTER(...,"No matches")) on top of an Excel Table does everything you need. It filters, it de-duplicates, and it won’t throw #CALC! on an empty result. The dropdown setup takes more steps, but it’s worth it if other people pick values from the sheet.

StepActionApplies To
1Confirm Microsoft 365, 2024, 2021, or webWindows, Mac, web
2Format data as a Table named SalesAll
3Enter FILTER or UNIQUE in an empty cellAll
4Point Data Validation at =$O$2#All

Before you call it done, verify the setup. Add a new row to the Sales table and confirm recalculation without saving and reopening. If the new row shows up in your FILTER output and your dropdown, the list is truly dynamic. If it doesn’t, the formula is probably pointing at a fixed range like A2:E21 instead of the table.