lolo
lolo

Reputation: 646

Extract unique values from a table in Google Sheet

I'm working on Google Sheet spreadsheets and I'm looking to get in a column the unique values of the table I show.

Suppose the table has the following values

A-B-C
B-C
A-D

With the Split function I can separate the values.

=SPLIT(B12;"-")

A   B   C
B   C   
A   D   

I'm stuck on the final point, which is to get the unique values.

A 
B 
C 
D

Upvotes: 1

Views: 2223

Answers (2)

pnuts
pnuts

Reputation: 59450

In a single formula (sorted, no blanks):

=sort(unique(transpose(split(textjoin("-",1,A:A),"-"))))

Upvotes: 1

CalamitousCode
CalamitousCode

Reputation: 1414

Assuming your data is in columns A:C, =UNIQUE({A1:A3;B1:B3;C1:C3}).

You can also unbind the ranges. =UNIQUE({A:A;B:B;C:C}).

The curly braces {} combine the ranges.

The semi colons ; tell the curly braces to combine the ranges vertically into a single column for the UNIQUE function to parse.

Upvotes: 1

Related Questions