DOLLAR rounds a number to a given number of decimal places and returns it as text,
formatted as currency. Microsoft's article names the format applied: $#,##0.00_);($#,##0.00)
— thousands separated, two decimals by default, negatives in parentheses — and states that the
currency symbol actually used depends on your language settings.
Decomposed, the operation is:
convert the argument to a number by the ordinary rules;
round it to decimals places — with negative decimals rounding to the left of the decimal
point, so -1 rounds to the nearest ten;
render the rounded value through the locale's currency format, including symbol placement,
grouping separator, decimal separator, and the negative-number convention, which follows the
sign of the input even when the value rounds to zero (FN-DOLLAR-001);
return the rendering as Text.
Step 3 is not a pure function of the arguments, and no argument can override it.
Arguments
number — required. The article describes it as a number, a reference to a cell containing a
number, or a formula that evaluates to a number.
decimals — optional, the number of digits to the right of the decimal point. Defaults to 2
when omitted, per the article. A negative value rounds the number to the left of the decimal
point.
Two positions that get misread:
decimals controls rounding, not just display. DOLLAR(1234.567, -1) is not 1234.567
displayed coarsely; the value rendered has been rounded first, and the digits are gone.
Whether a non-integer decimals is truncated, rounded, or rejected is not stated in the
article and has not been checked here.
Try it
Quirks
Result and edge cases
The return kind is Text. That is the most consequential fact on this page, and Microsoft's
article puts a warning box around it: numbers stored as text are a common cause of spreadsheet
errors, because many functions ignore them — SUM, AVERAGE, MIN, MAX. The article's own
advice is to use the Format Cells dialog or the Accounting Number Format instead, which keeps
the value numeric.
The Handbook's coercion chapter explains why the trap is asymmetric and therefore hard to
notice: SUM(DOLLAR(5)) as a direct argument coerces the text back to a number and gives
5, while the same text sitting in a cell and reached through a range scan is ignored and
contributes 0. The same string, the same function, two answers, decided by how the value
arrived (chapter 02).
Other boundaries:
Zero and negatives render through the format's negative branch, which is parenthesised in
the documented US format and is a leading minus in the recorded en-ZA settings, where
DOLLAR(-0.005,0) is -R0 (FN-DOLLAR-001). This is a locale-visible difference in the
shape of the output, not only in the symbol.
An empty cell as number converts to zero under the ordinary numeric coercion, so
DOLLAR of a blank is a rendering of zero rather than empty text.
Very large magnitudes must eventually exceed what a fixed-decimal rendering can express;
where that boundary lies, and whether it produces an error, is not documented in the article.
Errors
The article does not enumerate error conditions. The reachable errors are the shared ones: an
error value in either argument propagates, and non-numeric text as number fails to-number
conversion and surfaces #VALUE! under the shared coercion rules
(chapter 02).
Because step 3 above involves a host facility, a fourth failure mode exists in principle — a
locale profile that cannot render the requested combination — with no documented
worksheet-visible behaviour. Nothing about it has been observed here.
DOLLAR keeps the minus sign on an amount that rounds to zero; FIXED and TEXT drop it
-0.005 rounded to no decimals is zero. DOLLAR(-0.005,0) shows that as -R0 in en-ZA settings, keeping the sign of the input, while FIXED(-0.005,0), TEXT(-0.005,0) and TEXT(-0.005,"0") show 0.
Formula
Excel
Mathematical value
=DOLLAR(-0.005,0) Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
Typed formula.
-R0
—
=FIXED(-0.005,0) Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
Typed formula.
0
—
=TEXT(-0.005,0) Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
Typed formula.
0
—
=TEXT(-0.005,"0") Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
The locale profile is an input. An implementation that hard-codes $ and , is
implementing the en-US instance of this function, not the function. State the profile as
part of the result's scope, exactly as an Excel build and platform would be.
Round before rendering, once. Rounding inside the formatter and rounding beforehand can
differ at ties; the documented behaviour is a rounding step with an explicit decimals
argument, so keep it explicit.
Negative decimals is a rounding magnitude, not a formatting flag, and must still
render with the format's decimal count — FIXED(1234.567,-1) is documented as 1,230, and
the analogous DOLLAR case is worth pinning by probe rather than by analogy.
Rust code
Show the CalcFunc source of this function
Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.
No implementation has been published with a Handbook test suite for this function.
Version differences
No comparison between specific Excel builds is recorded here yet. This does not establish that all builds behave alike.
Excel 16.0.20527.20088
Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA
=DOLLAR(-0.005,0) returned -R0. Inputs were supplied through formula literals. These are controls from this environment, not a same-input comparison with another build.
Observed formulas and results
=DOLLAR(-0.005,0) → -R0(formula-literal)
Alternatives
Relationships
FIXED is the near-twin: same rounding-then-render-as-text shape, no currency symbol,
and an explicit no_commas switch that DOLLAR does not have. If you want grouped decimal
text without a currency symbol, FIXED is the function. See FIXED.
TEXT is the general case, taking an arbitrary format string; DOLLAR is TEXT with
the currency format baked in and the format argument replaced by a decimals count. The two
differ on an amount that rounds to zero: DOLLAR keeps the minus sign, TEXT drops it
(FN-DOLLAR-001).
VALUE and NUMBERVALUE are the inverse direction, parsing formatted text back to a
number — and NUMBERVALUE exists precisely because the inverse is locale-dependent too.
DOLLARDE and DOLLARFR share the word but not the job: they convert between fractional
and decimal notations of a price and return numbers, not text. They are unrelated to this
function despite the name collision, and readers confuse them regularly.
Cell number formatting is the non-function alternative the documentation recommends.