Could not find a trusted ready-made function to convert euro amounts to text in Latvian in Google Sheets. Created my own version using Google Apps Script, covered function with unit tests to validate correct conversion for various amounts.

Function supports conversion of amounts between minus one to one trillion; fractions of cents are not supported.

To use from your Google spreadsheet:

  • Navigate to Extensions -> Apps Script;
  • Copy-paste code here to Code.gs and save (⌘+S on Mac, Ctrl+S on Windows/Linux);
  • (Optional) To verify the conversion function works as expected, run unit tests: from the script toolbar, select the testEuroAmountToTextInLatvian function and press ▶️ Run. The execution log should look like below, resulting in 0 failed test cases.
    10:41:51 PM	Info	Starting tests...
    10:41:51 PM	Info	✓ Test 1 PASSED: 0 => "nulle eiro"
    10:41:51 PM	Info	✓ Test 2 PASSED: 1 => "viens eiro"
    ...
    10:53:36 PM	Info	✓ Test 55 PASSED: 987654321 => "deviņi simti astoņdesmit septiņi miljoni seši simti piecdesmit četri tūkstoši trīs simti divdesmit viens eiro"
    10:53:36 PM	Info	✓ Test 56 PASSED: 999999999999 => "deviņi simti deviņdesmit deviņi miljardi deviņi simti deviņdesmit deviņi miljoni deviņi simti deviņdesmit deviņi tūkstoši deviņi simti deviņdesmit deviņi eiro"
    ...
    10:41:52 PM	Info	========================================
    10:41:52 PM	Info	Total tests: 76
    10:41:52 PM	Info	Passed: 76
    10:41:52 PM	Info	Failed: 0
    10:41:52 PM	Info	========================================
    
  • Setup is complete. Now go back to your sheet and verify the function is working. For example, in any cell enter =euroAmountToTextInLatvian(123.45), which should result in viens simts divdesmit trīs eiro un 45 centi being displayed in the cell.