|
FIXED
Rounds a number to the specified number of decimals, formats the number in decimal format using a period and commas, and returns the result as text.
Syntax
FIXED(number,decimals,no_commas)
Number is the number you want to round and convert to text.
Decimals is the number of digits to the right of the decimal point.
No_commas is a logical value that, if TRUE, prevents FIXED from including commas in the returned text.
Remarks
- Numbers in a spreadsheet can never have more than 15 significant digits, but decimals can be as large as 127.
- If decimals is negative, number is rounded to the left of the decimal point.
- If you omit decimals, it is assumed to be 2.
- If no_commas is FALSE or omitted, then the returned text includes commas as usual.
Example
The example may be easier to understand if you copy it to a blank spreadsheet.
- Create a blank spreadsheet.
- Select the example in the Help topic.
Selecting an example from Help
- Press CTRL+C.
- In the spreadsheet, select cell A1, and press CTRL+V.
- To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | |
---|---|
1234.567 | |
-1234.567 | |
44.332 | |
Formula | Description (Result) |
=FIXED(A2, 1) | Rounds the first number 1 digit to the right of the decimal point (1,234.6) |
=FIXED(A2, -1) | Rounds the first number 1 digit to the left of the decimal point (1,230) |
=FIXED(-1234.567, -1, TRUE) | Rounds the second number 1 digit to the left of the decimal point, without commas (-1230) |
=FIXED(44.332) | Rounds the third number 2 digits to the left of the decimal point (44.33) |