UNIQUE scans the array argument and returns each distinct value in the order it first appears, spilling the results into adjacent empty cells automatically. The spill range expands or contracts as values are added to or removed from the source. Text comparison is case-insensitive. Blank cells are treated as a value -- if any blank exists in the range, one blank appears in the output. Wrap in FILTER to exclude blanks before deduplication: UNIQUE(FILTER(range,range<>"")). Wrap in
SORT for alphabetical ordering: SORT(UNIQUE(range)). Count the distinct values with COUNTA(UNIQUE(range)). For Excel 2019 and earlier where UNIQUE does not exist, the two practical workarounds are: Data > Remove Duplicates on a copy of the column for a one-time static unique list, or the legacy SUMPRODUCT formula =SUMPRODUCT(1/COUNTIF(range,range)) to count unique values without extracting them.