# Problem sorting dates via formula

Solved
2184 3
cancel
Showing results for
Did you mean:
5 - Automation Enthusiast

Hi community,

I’m trying to create a grid view with groups like the below, based on an ‘Event Date’ field:

Year Formula:

``````IF({Event Date}=BLANK(),"Date Missing",DATETIME_FORMAT({Event Date},'YYYY'))
``````

Month Formula

``````IF({Event Date}=BLANK(),"Date Missing",DATETIME_FORMAT({Event Date},'MMMM'))
``````

Why is April coming before March? How do I fix this so that months are sorted in sequential order (eg March -> April -> May)?

Many thanks in advance! Let me know if you need any other information from me on this.

1 Solution

Accepted Solutions
5 - Automation Enthusiast

Ah, I believe I have found the solution via Lillian_Shaw (which isn’t really a true solution, as Jack_Franz1 points out😞

Figured it out! Also, I used the concatenate featured to combine the Month number and written out, so I can read the month but have it ordered chronologically. I just hide the extra non-combined fields. Airtable win!

You have to create the Month# field and Month Name field, then use the formula: CONCATENATE({Month#} & “-” & Month Name)

Alternatively from Alex_Githatu:

This can also be shortened to:

`DATETIME_FORMAT(Date,'MM - MMMM')`

3 Replies 3
13 - Mars

Hi @Alex_Blanes,

Use the Sort option to Sort the Event Date Field, this will make sure it is in chronological order. Right now it is in alphabetical order by month name.

BR,
Mo

5 - Automation Enthusiast

Unfortunately, this does not solve the underlying issue. Here’s a 1-minute video explaining the problem.

Any ideas?

5 - Automation Enthusiast

Ah, I believe I have found the solution via Lillian_Shaw (which isn’t really a true solution, as Jack_Franz1 points out😞

Figured it out! Also, I used the concatenate featured to combine the Month number and written out, so I can read the month but have it ordered chronologically. I just hide the extra non-combined fields. Airtable win!

You have to create the Month# field and Month Name field, then use the formula: CONCATENATE({Month#} & “-” & Month Name)

Alternatively from Alex_Githatu:

This can also be shortened to:

`DATETIME_FORMAT(Date,'MM - MMMM')`