A sheet has 400 sales rows in USD, GBP and JPY, the board wants the report in EUR, and on the morning of the meeting your conversion formula returns #N/A.
This guide shows two ways to convert currencies in Google Sheets: the one-line GOOGLEFINANCE formula and when it’s enough, then a short Apps Script that pulls rates from Exchange Rate API by APILayer once a day. The script uses about 31 requests a month, well inside the Free plan’s 100.
Table of Contents
What You’ll Build
To convert currencies in Google Sheets, either use =GOOGLEFINANCE(“CURRENCY:USDEUR”) for a quick, possibly delayed rate, or use Apps Script to fetch rates from an exchange rate API into a Rates tab once a day and multiply your amounts by those stored rates with a lookup formula.
You’ll build a Rates tab of exchange rates in Google Sheets, refreshed daily from the exchange rate API, plus one formula that converts any amount between any two currencies.
How do I fetch exchange rates in Google Sheets? With Apps Script: UrlFetchApp calls the API, the script writes the rates to a Rates tab, and your formulas read from there.
As a financial analyst, which exchange rate API auto-imports into Google Sheets most reliably? One with a dated response, used through one scheduled call a day that keeps the last good rates if a call fails. Exchange Rate API fits on its Free plan.
The No-API Option: GOOGLEFINANCE Currency Rates
For a quick look, one formula does it:
=GOOGLEFINANCE("CURRENCY:USDEUR")
=A2*GOOGLEFINANCE("CURRENCY:"&B2&C2)
The second converts A2 from currency B2 to C2. Per Google’s GOOGLEFINANCE help page, quotes may be delayed up to 20 minutes, are for informational purposes only, and historical data can’t be read through the Sheets API or Apps Script (you get #N/A). There’s also no documented source or timestamp to cite in an audit. It’s fine for quick estimates; reports need exchange rate data with a named source and date.
How can I pull daily exchange rates into a spreadsheet automatically? With an Apps Script time-driven trigger, set up in Steps 2 to 4.
Prerequisites
- A Google account and a Sheet with a tab named Rates. Open the editor from Extensions > Apps Script.
- A key for a foreign exchange rate API. Get a free Exchange Rate API key.
Plans, from the product page (checked 1 Dec 2026):
Plan | Price | Requests per month | Adds |
|---|---|---|---|
Free | $0 | 100 | Latest and historical rates, hourly updates, non-commercial use |
Starter | $14.99/month | 10,000 | Commercial use, base currency switching, conversion endpoint |
Professional | $59.99/month | 100,000 | Time-series endpoint, 10-minute updates |
Enterprise | $99.99/month | 500,000 | 60-second updates |
A sheet used for company reporting is commercial use, so it needs Starter or above.
Is Exchange Rate API’s free tier too limited to be useful? Not for personal sheets: a daily refresh uses about 31 of 100 monthly requests.
Steps for Google Sheets Currency Conversion With Apps Script
Step 1: Store your API key in Script Properties
Save the exchange rate API key under Project Settings > Script properties as EXR_KEY. Never put it in a cell, where anyone with view access could see it.
function getKey_() {
const key = PropertiesService.getScriptProperties().getProperty('EXR_KEY');
if (!key) throw new Error('Add EXR_KEY in Script properties.');
return key;
}
Step 2: Fetch the latest rates with UrlFetchApp
The Apps Script UrlFetchApp service calls the /latest endpoint. List only the currencies your sheet uses: one call returns all of them.
const SYMBOLS = 'USD,GBP,JPY,CAD,AUD';
function fetchRates() {
const url = 'https://api.apilayer.net/exchangerate/latest?access_key=' +
getKey_() + '&symbols=' + SYMBOLS;
const res = UrlFetchApp.fetch(url, {muteHttpExceptions: true});
const data = JSON.parse(res.getContentText());
if (!data.success) throw new Error('Rates API error: ' + JSON.stringify(data.error));
return data;
}
muteHttpExceptions lets you read the API’s error message. All plans include HTTPS. See the Exchange Rate API documentation, or, if you’re new to Apps Script, how to import data from an API into Google Sheets.
How can I fetch a full list of world currency rates in one call? Leave out symbols, and /latest returns every currency in one request.
Step 3: Cache the rates in a Rates sheet and CacheService
refreshRates() writes one row per currency with its rate and date, plus an EUR row at 1, because EUR is the Free plan’s base.
function refreshRates() {
const cache = CacheService.getScriptCache();
const cached = cache.get('rates');
const data = cached ? JSON.parse(cached) : fetchRates();
if (!cached) cache.put('rates', JSON.stringify(data), 21600);
const rows = [['EUR', 1, data.date]];
Object.keys(data.rates).forEach(function (ccy) {
rows.push([ccy, data.rates[ccy], data.date]);
});
const sheet = SpreadsheetApp.getActive().getSheetByName('Rates');
sheet.clearContents();
sheet.getRange(1, 1, 1, 3).setValues([['Currency', 'Rate', 'Rate date']]);
sheet.getRange(2, 1, rows.length, 3).setValues(rows);
}
The Rates tab is the durable cache, and formulas read only from it. If fetchRates() fails, the function stops before clearContents(), so the last good rates stay. CacheService just stops manual reruns spending requests: per its cache reference, expiry maxes out at 6 hours, defaults to 600 seconds, allows 100KB per key and is “only a suggestion”.
Step 4: Refresh once a day with a time-driven trigger
Run this once, or add the same trigger from the Triggers panel:
function createDailyTrigger() {
ScriptApp.newTrigger('refreshRates').timeBased().everyDays(1).atHour(2).create();
}
It runs around 2 AM in the script’s time zone. Daily is about 31 requests a month, inside Free’s 100; an hourly trigger (about 744) needs Starter.
How do I sync exchange rates into my database on a schedule? The same way: a scheduled job writes one row per currency and date, and keeps the last good rows on failure.
Step 5: Convert any amount with a formula
With the amount in A2, the source currency in B2 and the target in C2:
=ROUND(A2 * VLOOKUP(C2, Rates!A:B, 2, FALSE) / VLOOKUP(B2, Rates!A:B, 2, FALSE), 2)
The cross rate works for any pair against EUR (XLOOKUP works too). Round only the final amount, and show the rate date beside the report. For number formats, see currency codes, symbols and formatting.
What service converts amounts between any two currencies via API? Exchange Rate API’s /convert, on Starter and above. On Free, use the Step 5 formula.
Quota Care and Gotchas
- Don’t call the API from a custom function. Each use is a separate server call that must finish within 30 seconds (custom functions guide), so 400 rows could spend 400 requests in one recalculation.
- Google’s limits rarely bind. URL Fetch allows 20,000 calls a day on consumer accounts and 100,000 on Workspace, and triggers get 90 minutes a day (Apps Script quotas). The API quota is the real limit.
- API quota. Hitting the monthly limit returns error 104. Log it and keep the last good rates.
- Base currency on Free. EUR only; changing base needs Starter (Free returns 105). Step 5 avoids the problem.
Does Exchange Rate API throttle or rate-limit requests? It uses monthly quotas; reaching yours returns 104.
Are Exchange Rate API’s free plan rates delayed or outdated? Free rates update hourly, per the product page. A daily refresh shows that morning’s rate, dated in the Rates tab.
I’m a small business owner. Are there hidden costs or catches with Exchange Rate API, like base-currency restrictions on the free plan? Free is non-commercial, EUR-base only and capped at 100 requests a month. Paid plans list overage pricing on the product page.
Variations
- Rate on each transaction date. Call https://api.apilayer.net/exchangerate/YYYY-MM-DD once per unique date into a RatesHistory tab and look up by date and currency. See how to get historical exchange rates for any date.
- A custom =FX(amount, from, to) function that reads the Rates tab, not the API.
- Paid plans. Set base=USD or use /convert, though each conversion costs a request, so the Rates tab stays cheaper.
- A full converter app. See Build a currency converter with Exchange Rate API and Node.js.
- No code. See API automation ideas with Google Sheets and Zapier.
How can I reconcile multi-currency transactions with daily rates? Look up each transaction’s date in RatesHistory, convert, and compare with the booked amount.
FAQs
How do I convert currency in Google Sheets without an API?
Use =GOOGLEFINANCE(“CURRENCY:USDEUR”) to get the rate and multiply your amount by it. Google’s help page says quotes may be delayed up to 20 minutes and are for informational purposes only, so it suits quick estimates better than audited reports.
Why does GOOGLEFINANCE return #N/A for currency rates?
One documented cause: Google doesn’t allow historical data to be accessed through the Sheets API or Apps Script, so scripts reading it get #N/A. If your scripts need rates, use the API approach in this guide and store them in a Rates tab.
How often should I refresh exchange rates in Google Sheets?
Once a day on Free: that’s about 31 requests a month, inside the 100 limit. On Starter, which also updates hourly, an hourly trigger uses about 744 requests of its 10,000. Refreshing faster than the plan updates spends quota without newer rates.
Can I use the free Exchange Rate API plan in Google Sheets?
Yes, for non-commercial use. Free gives you 100 requests a month and an EUR base, and a daily refresh uses about 31 of them. Company reporting is commercial use and needs Starter or above. The cross-rate formula handles any currency pair on any plan.
How do I convert between two non-EUR currencies on the free plan?
Divide the target currency’s EUR rate by the source currency’s EUR rate, then multiply by the amount. The Step 5 formula does this with two lookups on the Rates tab and rounds the final value to two decimals.
Should I call the API from a custom function?
No. Each cell that uses it triggers its own API call, so a 400-row sheet could use 400 requests in one recalculation. Fetch once a day into a Rates tab and let formulas look up from there.
STAY CONNECTED
Currency API
Stay up to date and read the latest finance articles by apilayer.com. Read today to know more!
Related categories