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.
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.
SORT returns a dynamic array of results.