﻿ Google sheets - How to get the price of a currency

What you are looking for is likely the following:

``````=GOOGLEFINANCE("CURRENCY:<firstCurrency><secondCurrency>")
``````

You simply supply the two currencies you want the exchange rate between, for example:

``````=GOOGLEFINANCE("CURRENCY:EURUSD")
``````

The above gives 1,08 as of now (2022-04-10). You can also reverse them:

``````=GOOGLEFINANCE("CURRENCY:USDEUR")
``````

Which gives 0,92 as of now.

### For a specific date

A post on dev.to also describes how to get the price on a specific date:

``````=INDEX(GOOGLEFINANCE("CURRENCY:USDDKK","price", "2019-01-01"),2,2)
``````

You do as previously described but you also provide it with a date. The INDEX function surrounding the GOOGLEFINANCE function is due to this method returning a table and not a single value.

Based on the above I have made two tables below:

You can find my spreadsheet of this here. This is an easy way to see different currencies against a base currency, I use this for my own stock overview in Google sheets.

What I do is define a base currency. For me that is DKK, but for most reading this it is likely USD, EUR or INR. I then use the following function for every currency I want the price against:

``````=IF(A4 = \$B\$1, 1, GOOGLEFINANCE(CONCATENATE("CURRENCY:",A4,\$B\$1)))
``````

In the above I return 1 if the base currency is the same as the target currency. That is because the exchange rate between the same currency (for example USD vs USD) is 1. Another reason is that the API fails if you give it the same currency twice. If they are not the same I concatenate a string with the target currency and base currency. This string is then used against the Google finance API, giving us the exchange rate.