EUROCONVERT function
The EUROCONVERT
function in Jspreadsheet Formulas Pro is a handy tool that allows you to convert a numerical value from one currency to another. You simply need to specify the value you want to convert, the original currency, and the currency you want to convert it into. This function is particularly useful for international transactions or financial analysis involving multiple currencies. Remember to ensure the currency codes you input are in the correct format for the function to work properly.
Documentation
The EUROCONVERT function converts a number from one currency to another
Category
Financial Functions
Syntax
EUROCONVERT(number, source_currency, target_currency, full_precision, triangulation)
Parameter | Description |
---|---|
number |
The number to convert. |
source_currency |
The currency code for the source currency, in ISO format. |
target_currency |
The currency code for the target currency, in ISO format. |
full_precision |
An optional logical value, either TRUE or FALSE, that specifies whether to use full precision in the calculation. Defaults to FALSE. |
triangulation |
An optional logical value, either TRUE or FALSE, that specifies whether to use triangular conversion when there is no direct exchange rate between the source and target currencies. Defaults to FALSE. |
Behavior
The EUROCONVERT
function is used to convert a number from one currency to another, specifically for Euro and its participating countries. The function requires three arguments: the number to convert, the currency to convert from, and the currency to convert to.
- Empty cells: If any of the required arguments are empty, the function will return an error.
- Text: If text is inputted instead of a number for the first argument, the function will return an error. Text values for the currency arguments should correspond to valid currency codes, otherwise, an error will be returned.
- Booleans: Boolean values are not acceptable inputs for this function. Providing a Boolean value will return an error.
- Errors: If an error exists in the input cells, the
EUROCONVERT
function will propagate that error. - Numbers: The function will successfully convert the number from the original currency to the target currency if both currency codes are valid.
Common Errors
Error | Description |
---|---|
#VALUE! | If the input currency code or the output currency code is not a valid currency code, this error will be displayed. |
#NUM! | If the calculation cannot be completed due to invalid numeric values or conversion rates, this error will be displayed. |
#N/A | If the specified currency code is not supported or no conversion path exists, this error will be displayed. |
Best practices
- Always ensure that the currency codes used are valid. The function only works with Euro and its participating countries' currencies.
- Avoid using cell references that might contain non-numeric values for the number to be converted.
- Use error handling functions like
IFERROR
to handle potential errors and maintain the cleanliness of your data presentation.
Usage
A few examples using the EUROCONVERT function.
EUROCONVERT(100,'EUR','DEM')
// Returns the equivalent of 100 Euros in Deutsche Marks
EUROCONVERT(50,'DEM','EUR',TRUE)
// Returns the equivalent of 50 Deutsche Marks in Euros with full precision
EUROCONVERT(75,'FRF','EUR',FALSE,TRUE)
// Returns the equivalent of 75 French Francs in Euros using triangulation
EUROCONVERT(A2,B2,C2,D2,E2)
// Converts the value in A2 from currency in B2 to currency in C2, with precision from D2 and triangulation from E2
Interactive Spreadsheet Demo
<html>
<script src="https://jspreadsheet.com/v11/jspreadsheet.js"></script>
<script src="https://jsuites.net/v5/jsuites.js"></script>
<link rel="stylesheet" href="https://jsuites.net/v5/jsuites.css" type="text/css" />
<link rel="stylesheet" href="https://jspreadsheet.com/v11/jspreadsheet.css" type="text/css" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons" />
<script src="https://cdn.jsdelivr.net/npm/@jspreadsheet/formula-pro/dist/index.min.js"></script>
<div id="spreadsheet"></div>
<script>
// Set your JSS license key (The following key only works for one day)
jspreadsheet.setLicense('MWI1MjkzNGJhMzVjZjg2MGI4ZDA2M2I0NTZlMGMwZjA3OTIxODEzMTRiNzYxNTQ3YjNhNjFkZjRjNzRkNDViNDBlY2Q2ZGMxYjVjZjQ0ZTg2MjcyMzAxMzEyN2VlNzIyYzA2ODc4OWIyNWU1YmU4ODA5NjcyODllMzA1NDZlOGYsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpVM01ETXdPVEF6TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2lkMlZpSWl3aWJHOWpZV3hvYjNOMElsMHNJbkJzWVc0aU9pSXpOQ0lzSW5OamIzQmxJanBiSW5ZM0lpd2lkamdpTENKMk9TSXNJbll4TUNJc0luWXhNU0lzSW1Ob1lYSjBjeUlzSW1admNtMXpJaXdpWm05eWJYVnNZU0lzSW5CaGNuTmxjaUlzSW5KbGJtUmxjaUlzSW1OdmJXMWxiblJ6SWl3aWFXMXdiM0owWlhJaUxDSmlZWElpTENKMllXeHBaR0YwYVc5dWN5SXNJbk5sWVhKamFDSXNJbkJ5YVc1MElpd2ljMmhsWlhSeklpd2lZMnhwWlc1MElpd2ljMlZ5ZG1WeUlpd2ljMmhoY0dWeklpd2labTl5YldGMElsMHNJbVJsYlc4aU9uUnlkV1Y5');
// Set the extensions
jspreadsheet.setExtensions({ formula });
// Create a new spreadsheet
jspreadsheet(document.getElementById('spreadsheet'), {
worksheets: [{
data: [
[
"Amount",
"From",
"To",
"Full Precision",
"Triangulation",
"Converted Amount"
],
[
100,
"EUR",
"DEM",
false,
false,
"=EUROCONVERT(A2,B2,C2,D2,E2)"
],
[
50,
"DEM",
"EUR",
true,
false,
"=EUROCONVERT(A3,B3,C3,D3,E3)"
],
[
200,
"FRF",
"ITL",
false,
true,
"=EUROCONVERT(A4,B4,C4,D4,E4)"
],
[
75,
"ESP",
"EUR",
true,
true,
"=EUROCONVERT(A5,B5,C5,D5,E5)"
]
]
}]
});
</script>
</html>
import React, { useRef } from "react";
import { Spreadsheet, Worksheet, jspreadsheet } from "@jspreadsheet/react";
import formula from "@jspreadsheet/formula-pro";
import "jsuites/dist/jsuites.css";
import "jspreadsheet/dist/jspreadsheet.css";
// Set license
jspreadsheet.setLicense('MWI1MjkzNGJhMzVjZjg2MGI4ZDA2M2I0NTZlMGMwZjA3OTIxODEzMTRiNzYxNTQ3YjNhNjFkZjRjNzRkNDViNDBlY2Q2ZGMxYjVjZjQ0ZTg2MjcyMzAxMzEyN2VlNzIyYzA2ODc4OWIyNWU1YmU4ODA5NjcyODllMzA1NDZlOGYsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpVM01ETXdPVEF6TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2lkMlZpSWl3aWJHOWpZV3hvYjNOMElsMHNJbkJzWVc0aU9pSXpOQ0lzSW5OamIzQmxJanBiSW5ZM0lpd2lkamdpTENKMk9TSXNJbll4TUNJc0luWXhNU0lzSW1Ob1lYSjBjeUlzSW1admNtMXpJaXdpWm05eWJYVnNZU0lzSW5CaGNuTmxjaUlzSW5KbGJtUmxjaUlzSW1OdmJXMWxiblJ6SWl3aWFXMXdiM0owWlhJaUxDSmlZWElpTENKMllXeHBaR0YwYVc5dWN5SXNJbk5sWVhKamFDSXNJbkJ5YVc1MElpd2ljMmhsWlhSeklpd2lZMnhwWlc1MElpd2ljMlZ5ZG1WeUlpd2ljMmhoY0dWeklpd2labTl5YldGMElsMHNJbVJsYlc4aU9uUnlkV1Y5');
// Set the extensions
jspreadsheet.setExtensions({ formula });
export default function App() {
// Spreadsheet array of worksheets
const spreadsheet = useRef();
// Worksheet data
const data = [
[
"Amount",
"From",
"To",
"Full Precision",
"Triangulation",
"Converted Amount"
],
[
100,
"EUR",
"DEM",
false,
false,
"=EUROCONVERT(A2,B2,C2,D2,E2)"
],
[
50,
"DEM",
"EUR",
true,
false,
"=EUROCONVERT(A3,B3,C3,D3,E3)"
],
[
200,
"FRF",
"ITL",
false,
true,
"=EUROCONVERT(A4,B4,C4,D4,E4)"
],
[
75,
"ESP",
"EUR",
true,
true,
"=EUROCONVERT(A5,B5,C5,D5,E5)"
]
];
// Render component
return (
<Spreadsheet ref={spreadsheet}>
<Worksheet data={data} />
</Spreadsheet>
);
}
<template>
<Spreadsheet ref="spreadsheet">
<Worksheet :data="data" />
</Spreadsheet>
</template>
<script>
import { Spreadsheet, Worksheet, jspreadsheet } from "@jspreadsheet/vue";
import "jsuites/dist/jsuites.css";
import "jspreadsheet/dist/jspreadsheet.css";
import formula from "@jspreadsheet/formula-pro";
// Set license
jspreadsheet.setLicense('MWI1MjkzNGJhMzVjZjg2MGI4ZDA2M2I0NTZlMGMwZjA3OTIxODEzMTRiNzYxNTQ3YjNhNjFkZjRjNzRkNDViNDBlY2Q2ZGMxYjVjZjQ0ZTg2MjcyMzAxMzEyN2VlNzIyYzA2ODc4OWIyNWU1YmU4ODA5NjcyODllMzA1NDZlOGYsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpVM01ETXdPVEF6TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2lkMlZpSWl3aWJHOWpZV3hvYjNOMElsMHNJbkJzWVc0aU9pSXpOQ0lzSW5OamIzQmxJanBiSW5ZM0lpd2lkamdpTENKMk9TSXNJbll4TUNJc0luWXhNU0lzSW1Ob1lYSjBjeUlzSW1admNtMXpJaXdpWm05eWJYVnNZU0lzSW5CaGNuTmxjaUlzSW5KbGJtUmxjaUlzSW1OdmJXMWxiblJ6SWl3aWFXMXdiM0owWlhJaUxDSmlZWElpTENKMllXeHBaR0YwYVc5dWN5SXNJbk5sWVhKamFDSXNJbkJ5YVc1MElpd2ljMmhsWlhSeklpd2lZMnhwWlc1MElpd2ljMlZ5ZG1WeUlpd2ljMmhoY0dWeklpd2labTl5YldGMElsMHNJbVJsYlc4aU9uUnlkV1Y5');
// Set the extensions
jspreadsheet.setExtensions({ formula });
export default {
components: {
Spreadsheet,
Worksheet,
},
data() {
// Worksheet data
const data = [
[
"Amount",
"From",
"To",
"Full Precision",
"Triangulation",
"Converted Amount"
],
[
100,
"EUR",
"DEM",
false,
false,
"=EUROCONVERT(A2,B2,C2,D2,E2)"
],
[
50,
"DEM",
"EUR",
true,
false,
"=EUROCONVERT(A3,B3,C3,D3,E3)"
],
[
200,
"FRF",
"ITL",
false,
true,
"=EUROCONVERT(A4,B4,C4,D4,E4)"
],
[
75,
"ESP",
"EUR",
true,
true,
"=EUROCONVERT(A5,B5,C5,D5,E5)"
]
]
return {
data
};
}
}
</script>
import { Component, ViewChild, ElementRef } from "@angular/core";
import jspreadsheet from "jspreadsheet";
import * as formula from "@jspreadsheet/formula-pro";
// Set your JSS license key (The following key only works for one day)
jspreadsheet.setLicense('MWI1MjkzNGJhMzVjZjg2MGI4ZDA2M2I0NTZlMGMwZjA3OTIxODEzMTRiNzYxNTQ3YjNhNjFkZjRjNzRkNDViNDBlY2Q2ZGMxYjVjZjQ0ZTg2MjcyMzAxMzEyN2VlNzIyYzA2ODc4OWIyNWU1YmU4ODA5NjcyODllMzA1NDZlOGYsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpVM01ETXdPVEF6TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2lkMlZpSWl3aWJHOWpZV3hvYjNOMElsMHNJbkJzWVc0aU9pSXpOQ0lzSW5OamIzQmxJanBiSW5ZM0lpd2lkamdpTENKMk9TSXNJbll4TUNJc0luWXhNU0lzSW1Ob1lYSjBjeUlzSW1admNtMXpJaXdpWm05eWJYVnNZU0lzSW5CaGNuTmxjaUlzSW5KbGJtUmxjaUlzSW1OdmJXMWxiblJ6SWl3aWFXMXdiM0owWlhJaUxDSmlZWElpTENKMllXeHBaR0YwYVc5dWN5SXNJbk5sWVhKamFDSXNJbkJ5YVc1MElpd2ljMmhsWlhSeklpd2lZMnhwWlc1MElpd2ljMlZ5ZG1WeUlpd2ljMmhoY0dWeklpd2labTl5YldGMElsMHNJbVJsYlc4aU9uUnlkV1Y5');
// Set the extensions
jspreadsheet.setExtensions({ formula });
@Component({
standalone: true,
selector: "app-root",
template: `<div #spreadsheet></div>`
})
export class AppComponent {
@ViewChild("spreadsheet") spreadsheet: ElementRef;
// Worksheets
worksheets: jspreadsheet.worksheetInstance[];
// Create a new data grid
ngAfterViewInit() {
// Create spreadsheet
this.worksheets = jspreadsheet(this.spreadsheet.nativeElement, {
worksheets: [{
data: [
[
"Amount",
"From",
"To",
"Full Precision",
"Triangulation",
"Converted Amount"
],
[
100,
"EUR",
"DEM",
false,
false,
"=EUROCONVERT(A2,B2,C2,D2,E2)"
],
[
50,
"DEM",
"EUR",
true,
false,
"=EUROCONVERT(A3,B3,C3,D3,E3)"
],
[
200,
"FRF",
"ITL",
false,
true,
"=EUROCONVERT(A4,B4,C4,D4,E4)"
],
[
75,
"ESP",
"EUR",
true,
true,
"=EUROCONVERT(A5,B5,C5,D5,E5)"
]
]
}]
});
}
}