Converts a number to text using currency format, with the currency symbol and thousands separator. Essential for formatting currency values, financial reports, and displaying monetary amounts in Excel.
Master the fundamentals of Excel DOLLAR function
The DOLLAR function converts numbers to text formatted as currency with the dollar sign ($), thousands separator (comma), and specified decimal places. It's essential for formatting currency values in reports, financial statements, and any display where monetary amounts need to appear as formatted text.
Returns text, not a number
Always includes dollar sign
Automatically adds comma separators
Specify decimal places (default: 2)
Function-specific parameters
Function-specific return type
Format currency amounts in reports
Format numbers for user display
Combine currency with text strings
Format amounts in invoices
Exact matching required
Returns numeric position
Handles missing text gracefully
=DOLLAR(number, decimals)The number to convert to currency text format
The number of digits to the right of the decimal point (default: 2)
Text string formatted as currency
Description: Converts a number to text using currency format with the currency symbol ($) and thousands separator
Convert number to currency text
Formats number with dollar sign, comma separator, and 2 decimal places
Simple VBA implementation of DOLLAR function
' Basic DOLLAR in VBA
Range("B1").Value = Application.WorksheetFunction.Dollar(Range("A1").Value)
' Formats number in A1 as currency text
' Using VBA Dollar function
Dim numValue As Double
numValue = 1234.56
Range("B2").Value = Application.WorksheetFunction.Dollar(numValue)
' Returns: "$1,234.56"
' Format with specific decimals
Sub FormatCurrency()
Dim cell As Range
For Each cell In Range("A1:A10")
If IsNumeric(cell.Value) Then
cell.Offset(0, 1).Value = Application.WorksheetFunction.Dollar(cell.Value, 2)
End If
Next cell
End Sub
' Format with zero decimals
Sub FormatCurrencyNoDecimals()
Dim cell As Range
For Each cell In Range("A1:A10")
If IsNumeric(cell.Value) Then
cell.Offset(0, 1).Value = Application.WorksheetFunction.Dollar(cell.Value, 0)
End If
Next cell
End SubCustom currency formatting and validation
' Format currency with validation
Function FormatCurrencySafe(value As Variant, Optional decimals As Integer = 2) As String
If IsNumeric(value) Then
FormatCurrencySafe = Application.WorksheetFunction.Dollar(CDbl(value), decimals)
Else
FormatCurrencySafe = "$0.00"
End If
End Function
' Format range of values
Sub FormatRangeAsCurrency()
Dim cell As Range
For Each cell In Range("A1:A100")
If IsNumeric(cell.Value) And cell.Value <> "" Then
cell.NumberFormat = "$#,##0.00"
' Alternative: Use cell formatting instead of DOLLAR
End If
Next cell
End Sub
' Compare DOLLAR function vs cell formatting
Sub CompareFormattingMethods()
Range("A1").Value = 1234.56
Range("B1").Formula = "=DOLLAR(A1)"
Range("C1").Value = Range("A1").Value
Range("C1").NumberFormat = "$#,##0.00"
' B1 contains text "$1,234.56"
' C1 contains number 1234.56 formatted as currency
End SubFormat currency amounts in financial reports
Combine currency with text strings
Format amounts in invoices
Format whole currency amounts
DOLLAR returns text, so it cannot be used in calculations
=VALUE(DOLLAR(A1))Solution: Use the original number for calculations, or convert back with VALUE: =VALUE(DOLLAR(A1))
DOLLAR formats negative numbers with parentheses or minus sign
=IF(A1<0, "-" & DOLLAR(ABS(A1)), DOLLAR(A1))Solution: Negative numbers are formatted based on Excel settings. Use ABS and handle signs manually if needed.
Very large numbers may display in scientific notation before DOLLAR
=DOLLAR(A1)Solution: Ensure numbers are formatted before applying DOLLAR, or use TEXT function for more control.
DOLLAR always uses $ symbol regardless of regional settings
=TEXT(A1, "[$-409]#,##0.00")Solution: Use TEXT function with locale-specific format codes if you need different currency symbols.