'Unique month-year combinations in excel/google spreadsheets

I have one column (A) with dates and I want to create a column with unique month-year.

I could use the UNIQUE function but that requires creating an extra column (B) with: = DATE(YEAR(A1),MONTH(A1)) and the final column = UNIQUE(B1:B)

The question is, can I do it without creating the extra column?



Solution 1:[1]

When I used the answer from Feb 2018, I kept getting an odd date at the end of the list. It was because the blank cells were being taken into account.

I used FILTER to remove them. This gave me the unique month/year values

=UNIQUE(ARRAYFORMULA(DATE(YEAR(FILTER(A1:A10, A1:A10<>"")), MONTH(FILTER(A1:A10, A1:A10<>"")), 1)))

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Okhellohey