CY Function
Returns a currency value.
Syntax
CY(value, cyID)
Parameters
Name |
Required/Optional |
Data Type |
Description |
---|---|---|---|
value |
Optional |
Number or String |
A number or a string that includes currency-specific formatting. If not specified, the currency value is formatted according to the currency style in the system's Region and Language settings. |
cyID |
Optional |
Number |
A numeric currency ID or a three-character quoted string for the ISO 4217 abbreviation. |
Remarks
To specify a different currency, you must include a valid cyID. For a list, see About currency constants.
If value is incompatible with the designated currency type, or if an invalid argument such as "not a number" is specified, a #VALUE! error is returned. If value is greater than 922,337,203,685,477.5807 or less than -922,337,203,685,477.5808, a #VALUE! error is returned.
For better precision with very large currency values that include fractions of a unit, such as 3.6 trillion, use string arguments for value.
Specifying an invalid cyID returns an error.
Example 1
If the user's Region and Language settings specify United States dollars:
CY(999998.993)
Returns $999,998.99
Example 2
CY(12345678.993, "USD")
Returns $12,345,678.99
Example 3
CY(12345678.993, "DEM")
Returns 12,345,678.99 DEM
Example 4
CY(12345678.7832, "XXX")
Returns 12,345,678.78