All Collections
Custom Functions
How to Sort your data in Cryptosheets
How to Sort your data in Cryptosheets

Learn several techniques to dynamically sort your data from custom functions by column or data field

C
Written by Chris Ware
Updated over a week ago

How to Sort your data in Cryptosheets

There are several ways to do this depending on:

  • What specific data source you're using 

  • What version of Excel you have

  • Whether you're using Excel or Googlesheets

Sorting methods, tips & tricks

  1. Use Cryptosheets sort  custom functions argument

  2. Use a native data provider's available sorting parameters if available (example: ParadigmAPI)

  3. Use Excel or Googlesheet's native =SORT()   and =SORTBY()  functions to wrap any existing Cryptosheets custom function


Example #1: Using Cryptosheets 'sort' Argument

For Cryptosheets core custom functions (ie CS.OHLCV, CS.ORDERBOOKS etc) there are powerful built in sorting arguments available using the sort argument

➡️ For Excel
=CS.OHLCV("BTC","USD","Coinbase","SPOT","1day",,,{"sort","-trades_count"})
 

➡️ For Google
=SORT(CSQUERY("Nomics","dashboard"),3,false)
 


Example #2: Using A Data Provider's Native Sorting

Some data providers have native sort functionality built into their APIs and endpoints as parameters (ie Paradigm).

Here's an example (try to copy and paste into your sheet)

Excel

=CS.QUERY("Paradigm", "TA Historical", {"symbol","btc";"sort","change50";"order","asc"}) 

Googlesheets

=CSQUERY("Paradigm", "TA Historical", {"symbol","btc";"sort","change1";"order","desc"})

 

Example #3: Using Excel's =SORT() & =SORTBY() or Google's SORT()

  • Recently rolled out new functions from Excel allow powerful and easy sorting of any array by simply using the =SORT()  or =SORTBY()  functions to wrap any existing function including a Cryptosheets custom function

  • Googlesheets also has native sorting ability =SORT 

 

Did this answer your question?