Skip to content

lorenzodotta02/Finance-functions-for-Google-Sheets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Finance Functions for Google Sheets

GitHub Downloads License: GPL v3

A collection of custom Google Sheets functions designed as an alternative to GOOGLEFINANCE()

These functions retrieve updated prices for:

  • Bonds
  • ETPs (ETFs / ETCs / ETNs)
  • Cryptocurrencies
  • Commodities

Installation

Tutorial here


Available Custom Functions

Function Purpose
ETPPRICE(date; code; [stockExchange]; [currency]) Returns the latest price for an ETP (ETF/ETC/ETN)
BONDPRICE(date; isin; stockExchange) Returns the latest price for a bond
CRYPTOPRICE(date; symbol) Returns the latest cryptocurrency price
COMMODITYPRICE(date; name) Returns the latest spot price of a commodity (EUR/gram)

⚠️ Important: date must always be Utils!$A$1, this cell auto-refreshes every 15 minutes and forces recalculation.

⚠️ If you use the US locale, replace semicolons ; with commas.


Function Inputs Explained

ETPPRICE(date; code; [stockExchange]; [currency])

Returns the latest price for an ETP (ETF/ETC/ETN)

Parameters:

  • date → always Utils!$A$1
  • code → ISIN code/Yahoo Finance ticker
  • stockExchangeOPTIONAL but recommended MIC code (ISO 10383) of the market where the ETP is traded
  • currencyOPTIONAL Currency filter (e.g. "USD"). Only used when stockExchange is XLON (London Stock Exchange)

Optional parameter: stockExchange

This is only needed when you pass an ISIN and want to force a specific market.

Supported MICs:

MIC Exchange
XETR XETRA
XLON London Stock Exchange 🔥
XMIL Borsa Italiana
XAMS Euronext Amsterdam
XPAR Euronext Paris
XSWX SIX Swiss Exchange
XSTU Stuttgart Stock Exchange
XMUN Gettex
TGAT Tradegate

If omitted, the script selects an exchange automatically (if possible).

Optional parameter: currency

Only applies when stockExchange is XLON. Use it to select the trading currency of the ETP on the London Stock Exchange.

BONDPRICE(date; isin; stockExchange)

Returns the latest price for a bond

Parameters:

  • date → always Utils!$A$1
  • isin → ISIN code of the bond
  • stockExchangeMANDATORY MIC code (ISO 10383) of the market where the bond is traded

Supported MICs:

MIC Exchange
XAMS Euronext Amsterdam
XBRU Euronext Brussels
XLIS Euronext Lisbon
XOSL Oslo Børs
XPAR Euronext Paris
ALXB Euronext Growth Brussels
EXGM Euronext Growth Milan
ALXP Euronext Growth Paris
ENXL Euronext Access Lisbon
MLXB Euronext Access Brussels
XMLI Euronext Access Paris
VPXB Euronext Expert Market
ETLX EuroTLX
MOTX MOT
XMOT Euronext Access Milan
XOAM Nordic Alternative Bond Market
XMUN Gettex 🔥
TGAT Tradegate 🔥

CRYPTOPRICE(date; symbol)

Returns the latest cryptocurrency price.

Parameters:

  • date → always Utils!$A$1
  • symbol → cryptocurrency ticker (e.g. "BTC", "ETH")

⚠️ Requires a CoinMarketCap API key (see installation).

COMMODITYPRICE(date; name)

Returns spot prices for commodities in EUR per gram.

Parameters:

  • date → always Utils!$A$1
  • name → name of the commodity (e.g. "Gold")

Supported names:

  • "Gold"
  • "Silver"
  • "Platinum"
  • "Palladium"

Examples

=ETPPRICE(Utils!$A$1;"IE00BK5BQT80")               // Price of VWCE from a random exchange
=ETPPRICE(Utils!$A$1;"IE00BK5BQT80";"XETR")        // Price of VWCE from XETRA
=ETPPRICE(Utils!$A$1;"VWCE.DE")                    // Price of VWCE via Yahoo Finance
=ETPPRICE(Utils!$A$1;"IE00B3F81R35";"XLON";"GBP")  // Price of IEBC from LSE in GBP

=BONDPRICE(Utils!$A$1;"IT0005672024";"MOTX")       // Italian government bond (MOT)
=BONDPRICE(Utils!$A$1;"FR0014001NN8";"XPAR")       // French OAT on Euronext Paris
=BONDPRICE(Utils!$A$1;"NL0015000QL2";"XAMS")       // Bond on Euronext Amsterdam

=CRYPTOPRICE(Utils!$A$1;"BTC")                     // Bitcoin price

=COMMODITYPRICE(Utils!$A$1;"Gold")                 // Gold price (EUR/gram)

License

This project is licensed under the GNU General Public License v3.0.

See the LICENSE file for full terms.


Roadmap

Planned features and improvements for upcoming releases:

  • Improve scalability and performance of the Euronext bond pricing API
  • Add FUNDPRICE() for mutual funds, SICAVs, and non-ETF investment funds
  • Flutter companion app
  • London Stock Exchange (XLON) bonds