Converting year-month format to year-quarter [excel]

Viewed 27

I'd like to convert year-month (2022-Sep) to year-quarter (2022-Q3). I've found a way to do it, I was just wondering if there was an easier method just for my learning in the future.

=CONCAT(LEFT(L2;4);"-";IF(OR(RIGHT(L2;3)="Jan";RIGHT(L2;3)="Feb";RIGHT(L2;3)="Mar");"Q1";IF(OR(RIGHT(L2;3)="Apr";RIGHT(L2;3)="May";RIGHT(L2;3)="Jun");"Q2";IF(OR(RIGHT(L2;3)="Jul";RIGHT(L2;3)="Aug";RIGHT(L2;3)="Sep");"Q3";"Q4"))))

My year-month data was in L2.

I'd appreciate any advices how to make it easier.

Thank you!

0 Answers
Related