Microsoft Excel is packed with powerful functions that help users manage and analyze data efficiently. Among these, the UNIQUE and SORT functions are game-changers when it comes to organizing and filtering data. These functions simplify the process of extracting distinct values and arranging data in ascending or descending order.
In this guide, we’ll explore how to use UNIQUE and SORT effectively, along with practical examples.
1. The UNIQUE Function: Extracting Distinct Values
The UNIQUE function helps you remove duplicates from a dataset and display only distinct values. This is particularly useful when working with lists of names, products, or categories.
Syntax:
=UNIQUE(array, [by_col], [exactly_once])
- array – The range or list from which you want to extract unique values.
- by_col (optional) – TRUE to check for unique values by column, FALSE (default) to check by row.
- exactly_once (optional) – TRUE to return only values that appear once, FALSE (default) to return all unique values.
Example:
Imagine you have a list of customer names in A2:A10, and you want to display only unique names in column C:
=UNIQUE(A2:A10)
This formula will list each name only once, removing duplicates automatically.
Extracting Unique Values That Appear Only Once
To find values that appear exactly once (ignoring repeated ones), use:
=UNIQUE(A2:A10, FALSE, TRUE)
2. The SORT Function: Organizing Data in Order
The SORT function allows you to arrange data in ascending or descending order effortlessly.
Syntax:
=SORT(array, [sort_index], [sort_order], [by_col])
- array – The range to be sorted.
- sort_index (optional) – The column or row number to sort by (default is the first column).
- sort_order (optional) – 1 for ascending (default) or -1 for descending order.
- by_col (optional) – TRUE to sort by column, FALSE (default) to sort by row.
Example:
If you have a list of product prices in B2:B10 and want to sort them in ascending order:
=SORT(B2:B10)
For descending order, use:
=SORT(B2:B10, , -1)
3. Combining UNIQUE and SORT for Clean Data
You can combine UNIQUE and SORT to get a distinct list of values sorted in order.
Example:
If you want a sorted list of unique customer names from A2:A10:
=SORT(UNIQUE(A2:A10))
This formula ensures your unique values are displayed in alphabetical order.
For a sorted list in descending order, use:
=SORT(UNIQUE(A2:A10), , -1)
When to Use These Functions?
- Use UNIQUE when you need to remove duplicates and get a clean list of distinct values.
- Use SORT when you need to arrange data in a specific order.
- Use both together to extract and organize unique values efficiently.
Get the cheapest Office keys with instant delivery and secure activation—save big on genuine Microsoft Office today!