Explanation
Although FILTER is commonly used to filter rows, you might also filter columns.
The trick is to use anincludeargument that operates on columns instead of rows.
Note: thenamed rangedatais used for convenience only; a regular range reference will also work fine.
This array is delivered to theUNIQUE function, which can automatically extract unique values from data with adjacent columns.
The SORT function is optional and can be removed.
This is a nice example ofnestingone function inside another.
When you see a formula created this way, learn to read from the inside out.
The inner functions deliver values to the outer functions.
The outermost function returns the final result.
The output from FILTER is dynamic.
If source data or criteria change, FILTER will return a new set of results.
Values can be sorted by one or more columns.
SORT returns a dynamic array of results.