Get month and year from date cells Excel
excel
Solution
Try this formula (it will return value from `A1` as is if it's not a date):
=TEXT(A1,"mm-yyyy")
Or this formula (it's more strict, it will return `#VALUE` error if `A1` is not date):
=TEXT(MONTH(A1),"00")&"-"&YEAR(A1)
Problem
I want to isolate `month` and `year` from a date column, but this column has two formats: 08 May 2011 00:59 and 08-05-2011. If I want to have a new column to isolate month and year from this column like: 05-2011, how should I do that?