All Collections
Custom Functions
CS.PRICE or CSPRICE - Pull Current & Historical Price Data for any pair across any exchange in Cryptosheets using custom functions
CS.PRICE or CSPRICE - Pull Current & Historical Price Data for any pair across any exchange in Cryptosheets using custom functions

How to use =CS.PRICE or =CSPRICE in Cryptosheets for Excel of Googlesheets

C
Written by Chris Ware
Updated over a week ago

How to use =CS.PRICE or =CSPRICE in Cryptosheets for Excel of Googlesheets

In its simplest form, the PRICE function says

=CS.PRICE(what base asset, what quoted asset, at what date or time, from what exchange, which type of price)

​​

​​

Use Case Scenarios

When you need to quickly pull in the latest price for specific assets pairs or the historical price at specific times

PRICE - Syntax

Function arguments

Arguments: =CS.PRICE("base","quote","time", "exchange", "returnValue")

Example Values: =CS.PRICE("BTC","USD","1/1/2020","COINBASE","BID")

Excel:

=CS.PRICE("BTC","USD","1/1/2020","COINBASE","BID")

Googlesheets:

=CSPRICE("BTC","USD","1/1/2020","COINBASE","BID")

Function argument descriptions

  • base: The cryptocurrency symbol of interest. [string] required

  • quote: Cryptocurrency symbol to convert into [string] required

  • time: Time at which exchange rate is calculated. (Optional, if not supplied then current rate is returned) [string] optional

  • exchange: Exchange to retrieve rate from. (Optional, if not supplied then current vwap rate is returned) [string] optional

  • returnValue: Return value of rate. (Optional, when is exchange is specified. If not supplied, the mid price is returned. Possible values include mid, ask, bid.) [string] optional

PARAMETERS - Absolute vs. Relative

Absolute Parameter Values

Formulas using absolute values for arguments with multiple parameters must be referenced inside an array using {"curly_brackets"} and will look like this:

Excel =CS.PRICE("BTC","USD","1/1/2020")
Googlesheets =CSPRICE("BTC","USD","1/1/2020")

Relative Parameter Values

Formulas using referenced values for arguments with multiple parameters must be referenced inside an array using a defined range and will look like this (*Note - {"curly_brackets"} are NOT required when using referenced values):

Excel =CS.PRICE("A1","A2","A3")
Googlesheets =CSPRICE("A1","A2","A3")

​​

Click here to search for data providers and endpoints

PRICE - Examples

TIP: Try copying + pasting the example formulas directly into your worksheet

Example 1:

Excel =CS.PRICE("BTC","USD")
Googlesheets =CSPRICE("BTC","USD")


Example 2:

Excel =CS.PRICE("ETH","USD","2019-01-01")
Googlesheets =CSPRICE("ETH","USD","2019-01-01")


Example 3:

Excel =CS.PRICE("BTC","USD","2011-01-01")
Googlesheets =CSPRICE("BTC","USD","2011-01-01")

Example 4:

Excel =CS.PRICE("BTC","USD","2011-01-01","COINBASE","BID")
Googlsheets =CSPRICE("BTC","USD","2011-01-01","COINBASE","BID")

TAGS: csprice, cs.price. =cs.price, =csprice, #NAME?, #ERROR!, custom functions, exchange, bid, ask, historical, bitcoin price, btc price, exchange rate

Did this answer your question?