I have data that looks like this:
campaign_type
marmay2022
janmar2022
mayjul2022
I'm trying to sort it based on the year and the first 3 character according to the month and year.
CodePudding user response:
Try:
Formula in C2
:
=INDEX(SORT({A2:A4,--("01/"&REPLACE(A2:A4,4,3,"/"))},2,1),0,1)
CodePudding user response:
Give a try on below formula-
=QUERY({A1:A3,ArrayFormula(DATEVALUE("01-"&LEFT(A1:A3,3)&"-"&RIGHT(A1:A3,4)))},"select Col1 order by Col2")