UNIQUE
Takes either a single array or a list of values and returns an array which contains each distinct value only once. In other words it turns either an array or a list of values into a set.
Syntax
=UNIQUE(array)
=UNIQUE(val1, val2, ...)
Examples
=UNIQUE([1, 2, 3, 2, 1])
→[1, 2, 3]
=UNIQUE(1, 2, 3, 2, 1)
→[1, 2, 3]
=UNIQUE([1, 2, 3, "A", "B", "B", 2, "C"])
→[1, 2, 3, "A", "B", "C"]
=UNIQUE([2, "A", 1, 3, "C", "B", 2, "A"])
→[2, "A", 1, 3, "C", "B"]
=UNIQUE([1, 2, 3], [1, 2], [1, 2])
→[[1, 2, 3], [1, 2]]
=UNIQUE([OBJECT("A", 1), OBJECT("A", 2), OBJECT("A", 1)])
→[{"A": 1}, {"A": 2}]
Updated 10 months ago