THE UNIQUE FUNCTION
In this article I will be talking about one of the The Dynamic Array Functions -the UNIQUE function. Before this function, we had to write a long nested formula and even an array formula in order to list the unique data in one or multiple columns. But now we can list the unique data in the field you want with a single and very simple function.
WHAT DOES IT DO
The UNIQUE function allows you to create from the data in the stated field. Use this function to return a list of unique values in a list or range. When you press Enter, the results can be displayed in a contiguous range with a suitable size.
=UNIQUE(array; [by_col]; [exactly_once])
There are 3 arguments in the function.
The first one is required, the other two are optional.
Now let’s take a look at what these arguments mean, i.e. what the function wants from us and what we will give it.
|The range or array from which to return unique rows or columns|
|The by_col argument is a logical value indicating how to compare.
TRUE will compare columns against each other and return the unique columns
FALSE (or omitted) will compare rows against each other and return the unique rows
|The exactly_once argument is a logical value that will return rows or columns that occur exactly once in the range or array. This is the database concept of unique.
TRUE will return all distinct rows or columns that occur exactly once from the range or array
FALSE (or omitted) will return all distinct rows or columns from the range or array
USE OF THE FUNCTION
We use this function to list the unique data in one column or multiple columns. For example, if we don’t know a formula to list the data in a row; we had to copy that column to a blank column and choose Remove Duplicates or we could list the Unique records only with the Advanced Filter. After writing this function, it will be enough to state the range from which we want the unique data.
You will see how easy it is one you watch the GIF below.
We have listed the unique data in the range we have stated by entering the first argument. Now let’s see what kind of results it returns with the other arguments.
The second arguments that is optional is the [by_col] argument.
TRUE and FALSE options are offered to us in this argument.
TRUE: Returns the unique columns.
FALSE: Returns the unique rows.
You can choose the FALSE option for the by_col argument if you want to get the unique data in any field.
UNIQUE / DUPLICATE DATA
The last argument [exactly_once] offers use two options concerning the data to be returned.
TRUE: Returns the data that is displayed only once. (Lists the ones that have been written only once, doesn’t take the ones written multiple times into consideration). FALSE: Returns all the different elements (Lists the unique ones in the range we choose).
We can choose the TRUE option if we want the data to be listed to be unique data only, and the FALSE option if we want the different data only.
Here is an example for that.
LONG LIVE THE NEW DYNAMIC ARRAY FUNCTIONS!
See you in other articles, bye. 🙋🏻♂️
You can share this post and help a lot of people get informed as well.👍🏻