The easiest way to do this is to use theUNIQUE function.

By default, UNIQUE will extract unique values in rows, so there is no special configuration needed.

The result is the same array, sorted by Group:

UNIQUE is adynamic function.

Excel formula: Extract unique items from a list

If any data in B5:C15 changes, the output from UNIQUE will update immediately.

Dynamic source range

UNIQUE won’t automatically adjust thesource rangeif data is added or deleted.

Values can be sorted by one or more columns.

Excel formula: Distinct values

SORT returns a dynamic array of results.

Excel formula: Count unique values

Excel formula: Unique values

Excel UNIQUE function

Excel SORT function