Excel Function: DOLLAR

Purpose

The DOLLAR function transforms a numeric value into a text value and formats it according to both the number & currency formatting rules set up on the computer on which it is being used. Numeric operations cannot be performed on the output of DOLLAR because it is always a text value. The DOLLAR function has 4 downsides and because of them the use of the DOLLAR function is not recommended.

  1. Formatting rules will vary between computers, meaning the output of DOLLAR will as well.
  2. The rules that affect the format of DOLLAR’s output are not what one would expect them to be.
  3. Modifying formatting rules to achieve a specific effect will likely impact other software.
  4. Its name causes confusion because DOLLAR is no more strongly connected with the US Dollar than any other currency.

The TEXT function should be favoured when numeric values must be transformed into text values and formatted as a currency.

Invocations of the DOLLAR function take the form:

DOLLAR(number, [decimals])

Example

Consider a cell containing the formula:

=DOLLAR(123456789.12,3)

The formula instructs the DOLLAR function to change the number “123456789.12” to have 3 digits following its decimal point, convert it to a text value, and format it according to the number & currency formatting rules on the computer on which the function is being used. To predict what the output will be, the formatting rules which affect the output of DOLLAR must first be understood. The following settings affect the formatting applied to a value by DOLLAR:

Formatting rule typeFormatting optionPurpose
NumberDecimal symbolDefines the character used by DOLLAR to represent a number’s decimal point.
NumberDigit grouping symbolDefines the symbol used by DOLLAR to represent digit grouping symbols.
CurrencyDigit groupingDefines the digit grouping pattern followed by digit grouping symbols.
CurrencyCurrency symbolDefines the currency symbol that DOLLAR adds to the output.
CurrencyPositive currency formatDefines the format of DOLLAR’s output when it is applied to numbers ≥ 0.
CurrencyNegative currency formatDefines the format of DOLLAR’s output when it is applied to numbers < 0.

The diagram below demonstrates that the output varies depending on the values assigned to the number & currency formatting options & because of this, one cannot expect the same results to be generated on different computers by formulae leveraging the DOLLAR function.

The output of the formula "=DOLLAR(123456789.12,3)" varies depending on the values assigned to 5 formatting options that are defined in the Windows OS. In the first example, the “number” formatting options “decimal symbol” and “decimal grouping symbol” are set to “.” (period) and “’” (apostrophe) respectively. The currency formatting options “digit grouping”, “currency symbol”, “positive currency format”, "positive currency format" are set to “12,34,56,789”, “€“ (Euro)”, “1.1 €“ and “€1.1-” respectively. The output is the text value “12'34'56'789.120 €”. In the second example, the “number” formatting options “decimal symbol” and “decimal grouping symbol” are set to “.” (period) and “,” (comma) respectively. The currency formatting options “digit grouping”, “currency symbol”, “positive currency format”, "positive currency format" are set to “123,456,789”, “£“ (GBP)”, “£1.1“ and “£1.1-” respectively. The output is the text value “£123,456,789.120”. The fact that the output of DOLLAR is dictated by settings outside of Excel demonstrate that one cannot expect it produce consistent results on different computers.

Arguments

ArgumentArgument typeDescription
numberMandatoryThe numeric value that will be converted to a text value.
decimalsOptional. Defaults to 2 if omitted.If a positive integer is supplied, it dictates the number of digits which appear in the result’s mantissa. If a negative integer is supplied, it dictates the number of digits to the left of the result’s decimal point which will be set to zero. Consider a situation in which number had a value of 12345 and decimals had a value of -3. the result would be “12000”. However, if decimals had a value of +3, the result would be “12345.000”.

Related Functions

FunctionExamplePurpose
TEXTTEXT(value,format_text)Converts a value of any type into text and applies a format code to it.

Error Conditions

Error valueCondition typeCondition
#VALUE!RuntimeA non-numeric value was supplied to the number argument.

Examples

ExampleFormulaResultDescription
1=DOLLAR(123456789.12,3)£123,456,789.120Transform a number greater than one into a text value, put 3 digits in the result’s mantissa and format it per the computer’s number & currency formatting rules.
2=DOLLAR(123456789.12,-3)£123,457,000Transform a number greater than one into a text value and, by supplying a negative number to the decimals argument, remove its mantissa and set the 3 least significant digits to the left of its decimal point to zero (0).
3=DOLLAR(0.123456789,3)£0.123Transform a number between zero and one into a text value, put 3 digits in the result’s mantissa and format it per the computer’s number & currency formatting rules.
4=DOLLAR(0.123456789,-3)£0Transform a number between zero and one into a text value and, by supplying a negative number to the decimals argument, remove its mantissa and set the 3 least significant digits to the left of its decimal point to zero (0).
5=DOLLAR(-123456789.12,3)-£123,456,789.120Transform a number less than minus one into a text value, put 3 digits in the result’s mantissa and format it per the computer’s number & currency formatting rules.
6=DOLLAR(-123456789.12,-3)-£123,457,000Transform a number less than minus one into a text value and, by supplying a negative number to the decimals argument, remove its mantissa and set the 3 least significant digits to the left of its decimal point to zero (0).
7=DOLLAR(-0.123456789,3)-£0.123Transform a number between zero and minus one into a text value, put 3 digits in the result’s mantissa and format it per the computer’s number & currency formatting rules.
8=DOLLAR(-0.123456789,-3)£0Transform a number between zero and minus one into a text value and, by supplying a negative number to the decimals argument, remove its mantissa and set the 3 least significant digits to the left of its decimal point to zero (0).

Examples: Errors

ExampleFormulaResultDescription
1=DOLLAR("a")#VALUE!Supplying a non-numeric value to the number argument causes the #VALUE! error.