# Multiple Sorts with Date

**URL:** https://community.glideapps.com/t/multiple-sorts-with-date/446
**Category:** Ask for Help
**Created:** [September 20, 2019, 3:29pm UTC](https://community.glideapps.com/t/multiple-sorts-with-date/446 "2019-09-20T15:29:27Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![dcmoody](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dcmoody/32/359_2.png) [@dcmoody](https://community.glideapps.com/u/dcmoody)
#### Post date: [September 20, 2019, 3:29pm UTC](https://community.glideapps.com/t/multiple-sorts-with-date/446/1 "2019-09-20T15:29:27Z")

</div>

So I know I can sort by multiple fields by creating an extra column that concatenates the values. But when one of the fields i want to sort by is a Date, it seems to ignore the data?

Is there a limit to the length of the sort column?

---

<div class="post-metadata">

### Author: ![George\_B](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/george_b/32/534_2.png) [@George\_B](https://community.glideapps.com/u/George_B)
#### Post date: [September 20, 2019, 3:34pm UTC](https://community.glideapps.com/t/multiple-sorts-with-date/446/2 "2019-09-20T15:34:23Z")

</div>

Ignored where? In Glide or in the spreadsheet? If in the spreadsheet, maybe if you share a sanitized copy of it someone could take a look at it and give you some guidance.

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [September 20, 2019, 3:39pm UTC](https://community.glideapps.com/t/multiple-sorts-with-date/446/3 "2019-09-20T15:39:50Z")

</div>

How is your date formatted in your extra column? Only YYYYMMDD is going to work properly. I think it’s Text(%date%, YYYYMMDD) You also need to pad spaces so each column, concated together, has a consistent width.

---

<div class="post-metadata">

### Author: ![dcmoody](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dcmoody/32/359_2.png) [@dcmoody](https://community.glideapps.com/u/dcmoody)
#### Post date: [September 20, 2019, 3:55pm UTC](https://community.glideapps.com/t/multiple-sorts-with-date/446/4 "2019-09-20T15:55:56Z")

</div>

Thank you Jeff! I did not realize that all the data had to be padded to the same length. This is the formula I ended up with, I also was replacing spaces with “-” to see if that was the issue, but will leave that in the code as well:

=arrayformula(if(len(A2:A) \> 0,text(C2:C,“yyyymmdd”)&substitute(A2:A," “,”-")&rept("-",max(len(A2:A))-len(A2:A))&SUBSTITUTE(B2:B," “,”-")&rept("-",max(len(B2:B))-len(B2:B)),""))
