Home ALL NEWS AND INFOZ DIGITAL SKILLS How to List and Sort Unique Values and Text in Microsoft Excel

How to List and Sort Unique Values and Text in Microsoft Excel

738
0
How to Find the Percentage of Difference Between Values in Excel How to Use Conditional Formatting to Find Duplicate Data in Excel Concatenate in Microsoft Excel Insert Excel Table Into Word With VBA How to List and Sort Unique Values and Text in Microsoft Excel When you want a list of customers, email addresses, product IDs, or something similar where each one is distinct, Excel has a function to help. We’ll show you how to use this function to list unique values and text.

How to List and Sort Unique Values and Text in Microsoft Excel

When you want a list of customers, email addresses, product IDs, or something similar where each one is distinct, Excel has a function to help. We’ll show you how to use this function to list unique values and text.

You can already use functions in Excel to total the number of distinct values. But here we’ll show you how to list those values instead using the UNIQUE function. Plus, we’ll throw in easy ways to sort the list and combine values.

Note:

As of March 2022, the UNIQUE function is available in Excel for Microsoft 365, Excel for the web, Excel 2021 or later, or Excel for iPhone, iPad, or Android phones or tablets.

Use the UNIQUE Function in Excel

You can use the UNIQUE function for text or numbers, decide how to compare the cell range, and opt to show results that only appear once.

The syntax for the function is UNIQUE(array, column, only_once) where only the first argument is required. Include the column argument to compare columns instead of rows and the only_once argument to return values that occur only one time in the array.

Should you choose to include the optional arguments, you’ll use the TRUE indicator in the formula for each. If no indicator is included, the function assumes FALSE.

As an example, we’ll create a list of customers for an email blast. Rather than use the existing list in cells A2 through A10 because some customers ordered more than once, we’ll make a new list where each customer appears one time.

=UNIQUE(A2:A10)

Unique Function In Excel

For another example, we’ll add the third argument, only_once, to find those customers who’ve only ordered once.

=UNIQUE(A2:A10,,TRUE)

Unique Function For Data Appearing Once

Because the second argument assumes FALSE if nothing is included, we simply add a comma after the first argument and then another comma before the last argument. Alternatively, you can use this formula to obtain the same result:

=UNIQUE(A2:A10,FALSE,TRUE)

You can use the UNIQUE function to list distinct values as well as text. In this formula, we can list unique dates:

=UNIQUE(F2:F10)

Unique Function For Dates

Sort the List Automatically

As mentioned, you can sort the list automatically at the same time you use the UNIQUE function to create it. To do this, you simply add the SORT function to the beginning of the formula.

Note: The SORT function is currently only available in the Excel versions listed earlier.

The syntax for this function is SORT(array, index, order, column) where only the first argument is required.

Using the first list of unique customers we created above and sort it immediately, you would use this formula:

=SORT(UNIQUE(A2:A10))

As you can see, the UNIQUE formula is the required array argument for the SORT function.

Sort Values In Ascending Order

By default, the SORT function lists items in ascending order. To sort the same list in descending order, you would use the following formula which adds the order argument.

=SORT(UNIQUE(A2:A10),,-1)

Notice here we have a double comma again. This is because we don’t want the index argument, only the order argument. Use 1 for ascending order and -1 for descending order. If no value is used, the function assumes 1 by default.

Sort Values In Descending Order

Combine Unique Values

One more handy addition to the UNIQUE function allows you to combine values. For instance, maybe your list has values in two columns instead of just one as in the screenshot below.

First And Last Names To Combine

RELATED ARTICLES

Basic Excel Functions Everybody Should Know
Essential Microsoft Excel Functions for Budgeting
Ways to Concatenate in Microsoft Excel
How to List and Sort Unique Values and Text in Microsoft Excel
How to Make One Page Landscape in Microsoft Word
Ways How to Rearrange Pages in Word
How to Make a Table of Contents in Word
How to Add Numbers in Microsoft Excel
How to Use Conditional Formatting to Find Duplicate Data in Excel
How to Find the Percentage of Difference Between Values in Excel
How to Compare Two Lists in Microsoft Excel

By adding the ampersand (&) operator and a space, we can create a list of first and last names of unique customers with this formula:

=UNIQUE(A2:A10&" "&B2:B10)

To break down the formula, the first array, A2 through A10, contains the first names, the ampersands concatenate the first names to the last names in B2 through B10 with a space between them in quotes.

Combine Unique First And Last Names

You can also include the SORT function here to put your list in ascending order with this formula:

=SORT(UNIQUE(A2:A10&" "&B2:B10))

Combine And Sort Unique First And Last Names

RELATED ARTICLES

Basic Excel Functions Everybody Should Know
Essential Microsoft Excel Functions for Budgeting
Ways to Concatenate in Microsoft Excel
How to List and Sort Unique Values and Text in Microsoft Excel
How to Make One Page Landscape in Microsoft Word
Ways How to Rearrange Pages in Word
How to Make a Table of Contents in Word
How to Add Numbers in Microsoft Excel
How to Use Conditional Formatting to Find Duplicate Data in Excel
How to Find the Percentage of Difference Between Values in Excel
How to Compare Two Lists in Microsoft Excel

LEAVE A REPLY

Please enter your comment!
Please enter your name here