Values
The values to transform.
ExactlyOnce
TRUE if no values in the given array should be part of the returned array if they appear multiple times in the given array, FALSE if all values in the given array should be part of the returned array, but only once. If omitted, FALSE is assumed.
Returns
The unique values of the given array.
Returns a version of the given array with all duplicate values removed. UNIQUE ({ 1, 2, 2, 3, 3, 3 }) UNIQUE ({ 1; 2; 2; 3; 3; 3 }) returns { 1, 2, 3 }{ 1; 2; 3 }.
If the ExactlyOnce parameter is TRUE, the returned array does not contain any values which are duplicated in the original array. This formula returns { 1 }{ 1 }, because 2 and 3 are duplicated in the given array:
Text strings are compared in a case-insensitive manner, and the first spelling is kept. This formula returns { "Ed", "Luke" }{ "Ed"; "Luke" }:
Removing duplicate rows from tables
If given a table, UNIQUE removes the rows which are duplicates of earlier rows. A row is a duplicate if all its values are equal to the values of the earlier row. This formula returns a table with two rows, one for Ed in Oslo and one for Luke in Rome:
Examples
Returns { 1, 2, 3 }{ 1; 2; 3 }, an array in which all values of the given array appear once, in the order they were encountered.
Returns { 1 }{ 1 }, an array in which only values appear which are not duplicated in the given array.