MNB Currency rates

Google Spreadsheets is a great asset to use instead of Microsoft Excel. It supports collaboration, functions in cells and has a great add-on system to extend its functionality.

Usually when there is a need to calculate with currency rates, the built-in Google rates is what everybody is using, but that is not a good solution when your enterprise is in Hungary. The Hungarian National Bank makes it's currency rates available publicly on a daily bases and even have an API to reach these rates from code. However the API uses a SOAP based approach which is not available anymore in Google add-ons. It seems Google decided that SOAP has reach it's end of life, at least in their platforms.

This add-on solves the issue using the Google App Scripting engine to create the missing link.

Privacy policy

To see how the the add-on uses your data, please check the Privacy page.

How to use it

Installing

  1. In the Add-ons menu in any Google Spreadsheet click on "Get add-ons"

  2. In the popup search for "MNB" using the search field.

  3. Click on the icon.

  4. Click on "Install".

  5. Approve the required access right - the app uses the minimum to be able to work within the Google Environment.

That's all...

Provided functions and using them

In cell start to type "=Mnb". Autocomplete will show the functions which are available:

  • MnbCurrencyRate
    Fetches Hungarian National Bank's currency rate for today in Hungarian Forint.
    Parameters:

      • currency (string) - optional, default: "EUR". The abbreviated name of the currency (like 'EUR')

      • unit (number) - optional, default: 1. The number of units you want the value for (like 42 - means get the HUF equals 42 EUR)

Returns a number in the cell.

  • MnbCurrencyRateByDate
    Fetches Hungarian National Bank's currency rate for a given date in Hungarian Forint.
    Parameters:

      • currency (string) - optional, default: "EUR". The abbreviated name of the currency
        (like 'USD')

      • date (string) - optional, default: today. The date on which the currency is needed
        (format: YYYY-mm-dd)

      • unit (number) - optional, default: 1. The number of units you want the value for
        (like 42 - means get the HUF equals 42 USD)

Returns a number in the cell.

  • MnbRatesDateRange
    Fetches Hungarian National Bank's valid date range for currency rates.
    Parameters: none

Returns two dates in two consecutive cells.

  • MnbRateCurrencies
    Fetches Hungarian National Bank's valid currencies for rates as a list.
    Parameters: none

Returns strings in multiple cells below each other.

  • MnbCurrencyRateByDateRange
    Fetches Hungarian National Bank's currency rates between two dates in Hungarian Forint.
    Parameters:

    • Currency(string): The abbreviated name of the currency (like 'USD')

    • startDate(string): The first date which the currency is needed for (YYYY-mm-dd)

    • endDate(string): The last date which the currency is needed for (YYYY-mm-dd)

    • prevValid (boolean): When TRUE and there is no value for a day, it will use the previous valid date's rate. Defaults to FALSE
      Returns an array of dates down in the column where the function is placed and the rates in the consecutive cell.