Formats a number as text with a fixed number of decimal places, with or without thousands separators. Essential for formatting numbers for display, reports, and consistent number formatting in Excel.
Master the fundamentals of Excel FIXED function
The FIXED function formats numbers as text with a fixed number of decimal places and optional thousands separators. It's essential for consistent number formatting in reports, displays, and when you need text representation of numbers with specific formatting.
Returns formatted text, not a number
Controls decimal places precisely
Includes comma separator by default
Rounds to specified decimal places
Function-specific parameters
Function-specific return type
Format numbers consistently in reports
Ensure consistent number display
Combine formatted numbers with text
Format numbers for presentations
Exact matching required
Returns numeric position
Handles missing text gracefully
=FIXED(number, decimals, no_commas)The number to format as text
The number of digits to the right of the decimal point (default: 2)
TRUE to omit thousands separators, FALSE to include them (default: FALSE)
Text string formatted with fixed decimals
Description: Formats a number as text with fixed decimal places and optional thousands separators
Format number with fixed decimals
Formats with 2 decimal places (default) and thousands separator
Simple VBA implementation of FIXED function
' Basic FIXED in VBA
Range("B1").Value = Application.WorksheetFunction.Fixed(Range("A1").Value)
' Formats number in A1 with 2 decimals
' Using VBA Fixed function
Dim numValue As Double
numValue = 1234.567
Range("B2").Value = Application.WorksheetFunction.Fixed(numValue)
' Returns: "1,234.57"
' Format with zero decimals
Sub FormatFixedZero()
Dim cell As Range
For Each cell In Range("A1:A10")
If IsNumeric(cell.Value) Then
cell.Offset(0, 1).Value = Application.WorksheetFunction.Fixed(cell.Value, 0)
End If
Next cell
End Sub
' Format without commas
Sub FormatFixedNoCommas()
Dim cell As Range
For Each cell In Range("A1:A10")
If IsNumeric(cell.Value) Then
cell.Offset(0, 1).Value = Application.WorksheetFunction.Fixed(cell.Value, 2, True)
End If
Next cell
End SubCustom formatting and validation
' Format with validation
Function FormatFixedSafe(value As Variant, Optional decimals As Integer = 2, Optional noCommas As Boolean = False) As String
If IsNumeric(value) Then
FormatFixedSafe = Application.WorksheetFunction.Fixed(CDbl(value), decimals, noCommas)
Else
FormatFixedSafe = "0.00"
End If
End Function
' Format range with consistent decimals
Sub FormatRangeFixed()
Dim cell As Range
Dim decimals As Integer
decimals = 2
For Each cell In Range("A1:A100")
If IsNumeric(cell.Value) And cell.Value <> "" Then
cell.Offset(0, 1).Value = Application.WorksheetFunction.Fixed(cell.Value, decimals)
End If
Next cell
End Sub
' Compare FIXED vs TEXT formatting
Sub CompareFormatting()
Range("A1").Value = 1234.567
Range("B1").Formula = "=FIXED(A1, 2)"
Range("C1").Formula = "=TEXT(A1, "#,##0.00")"
' Both format similarly, but FIXED is simpler
End SubFormat numbers consistently in reports
Combine formatted numbers with text
Ensure consistent number display
Format without thousands separator
FIXED returns text, so it cannot be used in calculations
=VALUE(FIXED(A1))Solution: Use the original number for calculations, or convert back with VALUE: =VALUE(FIXED(A1))
FIXED rounds numbers which may cause precision loss
=FIXED(A1, 2)Solution: This is expected. FIXED rounds to specified decimal places. Use original numbers for precise calculations.
FIXED formats negative numbers with minus sign
=IF(A1<0, "-" & FIXED(ABS(A1), 2), FIXED(A1, 2))Solution: Negative numbers are formatted with minus sign. Use ABS and handle signs manually if needed.
Very large numbers may display in scientific notation before FIXED
=FIXED(A1, 0)Solution: Ensure numbers are formatted before applying FIXED, or use TEXT function for more control.