The FIXED function in Google Sheets is a versatile tool designed to format numbers to a specified number of decimal places. This function not only allows users to set decimal precision but also provides options for displaying or omitting commas or showing the result in a monetary format. Whether for accounting, scientific calculations, or data presentation, the FIXED function is essential for achieving uniformity in numerical data presentation.
Syntax
FIXED(number, [decimals], [no_commas])
- number: The numeric value you wish to format.
- decimals: (Optional) The number of decimal places to display. Default is 2.
- no_commas: (Optional) A TRUE/FALSE value indicating whether to omit commas from the formatted number. Default is FALSE.
Example #1
FIXED(1234.5678, 2)
This function formats the number 1234.5678 to two decimal places, resulting in 1234.57.
Example #2
FIXED(9876.54321, 3, TRUE)
This function formats the number 9876.54321 to three decimal places without commas, resulting in 9876.543.
Example #3
FIXED(10000, 0, FALSE)
This function formats the whole number 10000 without any decimal places and includes commas, resulting in 10,000.
Error handling
- VALUE!: Occurs when the ‘number’ parameter is non-numeric. Ensure a valid numeric input is provided.
- NUM!: Happens if ‘decimals’ is a negative number. Always use a zero or positive value for decimal specification.
- REF!: Triggered if a reference to a cell is invalid. Check the cell references used in the function.