Tanika Syeda
Tanika Syeda

Reputation: 1

How can I sort by date order on my query formula?

My consolidated sheet query formula used is as following:

=query({'May/June 2022'!A4:I1002},"Select Col1, Col2, Col3, Col4, Col9 where Col1 is not null order by Col9 desc")

When sorting in date order, must it be in numerical format? The desire format for my dates are 19 MAY 2022, I was wondering if it was possible to sort by date order in that format??

However, even when I use the date format 19/05/2022, it sorts the data numerically, rather than by date.

Also, the locale of my sheet is UK, so this is the correct date format.

How can I fix this?

Thank you!

Upvotes: 0

Views: 453

Answers (1)

player0
player0

Reputation: 1

try:

=ARRAYFORMULA(QUERY({'May/June 2022'!A4:H, TEXT('May/June 2022'!I4:I, "dd mmm e")}, 
 "select Col1,Col2,Col3,Col4,Col9 
  where Col1 is not null 
  order by Col9 desc", ))

Upvotes: 0

Related Questions