Hey Coda, I’m going to give you a list. Can you sort that list either alphabetically or numerically. Oh! Can you also sort it with A-Z or Z-A?
Sort() has only onerequired parameter:
Dataset
Sort(Dataset)
The column or list that you want to sort.
Sort() has three optional parameters:
Ascending
Sort(Dataset, Ascending, SortBy, SortByCount)
True = ascending; False = descending. Defaults to true.
SortBy
Sort(Dataset, Ascending, SortBy, SortByCount)
What you want to sort the table on (i.e., a specific column).
SortByCount
Sort(Dataset, Ascending, SortBy, SortByCount)
True = sort by count; False = sort by value. Defaults to true.
In early grade school, organizing words in Alphabetical order is a big deal. If early grade school was a nightmare for you, Sort() will be your friend.
Sort() takes a list and then:
If it’s a list of words/sentences will sort them alphabetically.
If it’s a list of number values/dates, will sort them from lowest to highest.
Play around with the toggles below to see how Sort() and its Ascending parameter is working.
See the lists as unsorted
sorted
Sort Direction: 9 → 1
1 → 9
886762594846393526241614141211
Sort Direction: Z-A
A-Z
RabbitHorseGoose breedsGoatFancy rat varietiesDonkeyDogChicken breedsCattle
Alright - now what about all that other parameters? What is it for?
SortBy
SortBy is an optional parameter. Click into the lists of animals or numbers above and notice that you will not find it anywhere in those formula.
Where SortBy comes in handy is when you are trying to grab a sorted list of a table and want access to all the column values.
For example, let say you needed a list of the first 5 birthdays in this calendar year of people from the