• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member
  • Login

Excel Sorted Dynamic Unique List

You are here: Home / Excel Formulas / Excel Sorted Dynamic Unique List
Excel Sorted Dynamic Unique List
January 8, 2019 by Mynda Treacy

I really wanted the title of this post to be “Excel Sorted Dynamic Unique List Ignoring Blanks and Errors”, but I didn’t want to brag 😉

It has never been so easy to extract a unique or distinct list of values in Excel than it is now that we have Dynamic Array formulas*.

dynamic array formulas

*Dynamic Array formulas are only available in Office 365. I’ll provide links to an alternative for Excel 2019 and earlier versions at the bottom of this post.

Note: At the time of writing, Dynamic Arrays are only available in Office 365 and are currently in beta on the Insiders channel. We don’t have an ETA for when they will be available to all Office 365 users yet. And to be clear, Excel 2019 does not come with Dynamic Arrays. The only way to get them is with Office 365 …or wait until Excel 2022 (?) comes out.

Excel Sorted Dynamic Unique List Formula

The formula for extracting a list of sorted unique values that ignore errors and blanks is super easy.

Step 1: Format the source data in an Excel Table. That way when new rows are added, or rows removed, the formula will automatically pick up the changes.

Step 2: The formula.

The most complicated part of the formula, which isn’t really that complicated, is the FILTER function, that enables us to return the list excluding errors and blank cells, among other things. The UNIQUE and SORT functions then enclose FILTER.

The FILTER function takes the following arguments:

=FILTER(array , include, [if_empty])

The array argument is the table or range of cells you want to filter.

The include argument allows you to insert a logical test specifying which values to include.

The if_empty argument is an optional value to return if there are no records that match our ‘include’ criteria. We don’t need it in this example.

The formula is:

=SORT(
UNIQUE(
FILTER(Table1[Names], NOT(ISBLANK(Table1[Names]))*NOT(ISERROR(Table1[Names])) 
    )
  )
)

In English, the FILTER formula reads:

FILTER the Names column of Table1 and return a list of values, where the Names are not blank AND the Names are not errors.

The NOT(ISBLANK(Table1[Names])) and NOT(ISERROR(Table1[Names])) formulas return a list of TRUE and FALSE Boolean values as shown below:

=SORT(
UNIQUE(
FILTER(Table1[Names],
{TRUE;TRUE;TRUE;TRUE;TRUE;FALSE;TRUE;TRUE;FALSE;TRUE;TRUE;TRUE;TRUE}*
{TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;FALSE;TRUE})
  )
)

The FALSE values are discarded before passing the list to the UNIQUE function. The UNIQUE function then removes the duplicate names before passing the list to the SORT function, which sorts it in ascending order.

If you prefer the list sorted in descending order you can add  ‘,,-1’ to the SORT formula like so:

=SORT(
UNIQUE(
FILTER(Table1[Names],
NOT(ISBLANK(Table1[Names]))*NOT(ISERROR(Table1[Names]))
  )
 ), ,-1
)
 

Dynamically Update

And because I formatted the source for my Excel Sorted Dynamic Unique list in an Excel Table, when I add new names it automatically updates:

dynamic dinstinct list

Notice how the results automatically ‘spill’ to the cells below? This is the new Dynamic Array formula functionality available to Office 365 users.

Unique Lists in Earlier Versions of Excel

If you’re not fortunate enough to have Office 365 and these handy dynamic array formulas, you can use one of the techniques described here.

Related Lessons

SORT Function – there’s more to the SORT function than I’ve demonstrated here. You can also sort multiple columns and choose which column to sort by.

UNIQUE Function – the UNIQUE function can also handle multiple columns and differentiate between unique and distinct values.

FILTER Function  - you can filter more than one column and FILTER can handle OR criteria as well as AND criteria.

NOT Function – Not enables us to check if a logical test doesn’t exist.

ISBLANK Function and ISERROR Function – the IS functions check to see if a condition exists and return a TRUE FALSE, depending on the outcome. There are more IS functions at the link above.

Download the Workbook

Enter your email address below to download the sample workbook.

By submitting your email address you agree that we can email you our Excel newsletter.
Please enter a valid email address.

Download the Excel Workbook. Note: This is a .xlsx file please ensure your browser doesn't change the file extension on download.

Excel Sorted Dynamic Unique List
Mynda Treacy

Microsoft MVP logo

AUTHOR Mynda Treacy Co-Founder / Owner at My Online Training Hub

CIMA qualified Accountant with over 25 years experience in roles such as Global IT Financial Controller for investment banking firms Barclays Capital and NatWest Markets.

Mynda has been awarded Microsoft MVP status every year since 2014 for her expertise and contributions to educating people about Microsoft Excel.

Mynda teaches several courses here at MOTH including Excel Expert, Excel Dashboards, Power BI, Power Query and Power Pivot.

More Dynamic Arrays Posts

excel shaping arrays

New Array Shaping Excel Functions

The Excel Shaping Array Functions makes it easier than ever to reshape arrays and ranges using these purpose built functions
Excel LET Function

Excel LET Function

Excel LET Function allows you to declare variables and intermediate calculations inside of the formula improving readability and performance.
list_first_monday_date_in_each_month

List First Monday Date in Each Month

With the DATE and WEEKDAY functions we can easily list first Monday date in each month. With EOMONTH you can easily switch to the last Monday of each month.

Excel XLOOKUP Function

The new Excel XLOOKUP Function replaces the need for VLOOKUP, HLOOKUP, INDEX & MATCH and more. It’s available in Office 365.
Excel Hash 2019

Excel Hash 2019 – Dynamic Playoffs Table

Excel Hash Competition 2019 – dynamic playoffs table uses Icons, XOR, Dynamic Arrays and Linked Pictures to create an integrated solution.

Extract Values Present in Two Lists

Use an Excel formula to extract values present in two lists of varying sizes. Watch the video and download the Excel file with examples.
excel dynamic arrays

Excel Dynamic Arrays

The new Excel Dynamic Arrays will change the way you work with Excel formulas. As well as a host of new functions, CTRL+SHIFT+ENTER is no longer required.

More Excel Formulas Posts

Summarize Months to Quarters

Excel Formulas to Summarise Monthly Data into Quarters

3 ways (good, better, best) to summarize monthly data into quarters using formulas. Lots of examples and sample file to download.
Excel BYROW and BYCOL Functions

Excel BYCOL and BYROW Functions

Excel BYCOL and BYROW functions fundamentally change the way we write formulas that calculate across columns and down rows.
python in excel natively

How to Use Python in Excel Natively

How to use Python in Excel natively using libraries like Pandas, NumPy, Matplotlib, Seaborn and more for analysis and spectacular charts!
excel dynamic named ranges

Excel Dynamic Named Ranges

Excel Dynamic Named Ranges update automatically to include new data in the ranges referenced in your formulas and PivotTables etc.
functions for financial modelling

Excel Functions for Financial Modeling

Top 23 must know Excel functions for Financial Modeling. Includes example Excel file and step by step instructions.
excel formula by example

Excel Formula by Example

Excel can now write a formula by example. Simply give it an example or two of the result and Excel will write the formula.
ai-aided excel formula editor

AI Aided Excel Formula Editor

Save time with this free AI Excel formula editor add-in that writes, edits, improves and interprets formulas for you!
top excel functions for data analysts

Top Excel Functions for Data Analysts

Must know Excel Functions for Data Analysts and what functions you don’t have to waste time learning and why.
excel advanced formula environment

Excel Labs (Formerly, Advanced Formula Environment)

Excel Labs is a long awaited, new improved way to write, name and store Excel formulas, including LAMBDAS with the help of AI.
Pro Excel Formula Writing Tips

Pro Excel Formula Writing Tips

Must know Excel formula writing tips, tricks and tools to make you an Excel formula ninja, including a new formula editor.


Category: Excel FormulasTag: Dynamic Arrays
Previous Post:play audio and video files in excelPlay Audio and Video in Excel
Next Post:VBA Like Operatorvba like operator

Reader Interactions

Comments

  1. Cathrine

    September 6, 2021 at 7:38 pm

    Hi, I would like to know how to filter unique distinct data from two lists of different sheets and sorted by ascending or smallest to largest dynamically with huge data. (using 365 & Older version )
    Thanks in advance.

    Reply
    • Mynda Treacy

      September 6, 2021 at 7:46 pm

      No easy way to do this with formulas. I recommend you use Power Query to get the data from the two sheets and extract the sorted unique list.

      Reply
  2. Dave

    June 11, 2020 at 7:01 am

    I would like to know how to merge two workbooks (Last week and this week) into a single list or table then generate a list of new items and a list of items removed from the oldest list

    Reply
    • Mynda Treacy

      June 11, 2020 at 9:09 am

      Hi Dave, you can use Power Query to get data from multiple files in a folder and consolidate them into one table.

      Reply
  3. Peter B

    January 12, 2019 at 2:32 am

    Can the output list be a table?..
    i.e. source_table->formula->output_table

    I’m thinking of the use case of when I add data validation to a cell. I only want people to be able to enter into cell if it is an allowed value.. And the allowed values are the unique values of the source table.

    In the past, I’ve created the unique list using a pivot table and then used the values to drive the data validation.. but it’s a bit of a pain and requires the table to be refreshed.

    I can see that the dynamic array makes it much simpler to produce the unique list.. it’s then just how that simply feeds into the data validation.

    Hope that makes sense…

    Reply
    • Catalin Bombea

      January 12, 2019 at 3:50 pm

      Hi Peter,
      A formula will never create a defined table. Of course, you can always put this formula in an existing table. Or, you can set a defined name that will adjust to the result range size.
      Catalin

      Reply
  4. DonH

    January 8, 2019 at 10:43 pm

    In your example, you call the functions in the order of SORT(UNIQUE(FILTER())).
    In an application I list the formula in UNIQUE(SORT(FILTER())) order.
    Does the order matter? I have a noticeable pause while new entries update.

    Thanks…

    Reply
    • Mynda Treacy

      January 9, 2019 at 9:15 am

      Hi Don,

      I can’t see why it would matter which order you call the functions, so if you get better performance using UNIQUE(SORT(FILTER(… then I’d go with that.

      Mynda

      Reply
  5. Giorgio Rovelli

    January 8, 2019 at 8:42 pm

    “At the time of writing, Dynamic Arrays are only available in Office 365 and are currently in beta on the Insiders channel. We don’t have an ETA for when they will be available to all Office 365 users yet. And to be clear, Excel 2019 does not come with Dynamic Arrays.”
    What section of Office 365 users have access to Dynamic Arrays? We have Office 365 ProPlus version 1811 and if I type, for example, =RANDARRAY(, nothing happens.

    When you say Excel 2019 are you talking about a standalone installation(DVD)?

    Reply
    • Mynda Treacy

      January 8, 2019 at 9:14 pm

      Hi Giorgio,

      There are different update channels for Office 365. Only those on the Insider channel have Dynamic Arrays. I suspect you are on the Targeted, Monthly or deferred channel, which haven’t received dynamic arrays yet. I’m on Office Insider version 1901. The channel you’re on is stated under the version number in the Account section of the File tab.

      When I say Excel 2019 I’m talking about the perpetual license, not the Office 365 subscription license. i.e. pay for it once (Perpetual) vs pay a monthly or annual subscription.

      Mynda

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Current ye@r *

Leave this field empty

Sidebar

More results...

Popular Content

  • 10 Common Excel Mistakes to Avoid
  • Top Excel Functions for Data Analysts
  • Secrets to Building Excel Dashboards in Less Than 15 Minutes
  • Pro Excel Formula Writing Tips
  • Hidden Excel Double-Click Shortcuts
  • Top 10 Intermediate Excel Functions
  • 5 Pro Excel Dashboard Design Tips
  • 5 Excel SUM Function Tricks
  • 239 Excel Keyboard Shortcuts

100 Excel Tips and Tricks eBook

Download Free Tips & Tricks

239 Excel Keyboard Shortcuts

Download Free PDF

mynda treacy microsoft mvpHi, I'm Mynda Treacy and I run MOTH with my husband, Phil. Through our blog, webinars, YouTube channel and courses we hope we can help you learn Excel, Power Pivot and DAX, Power Query, Power BI, and Excel Dashboards.

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel Office Scripts
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook

Sign up to our newsletter and join over 400,000
others who learn Excel and Power BI with us.

 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate
  • Sponsor Our Newsletter

Support

  • Contact
  • Forum
  • Helpdesk – For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.