Function Reference: ROUND, ROUNDDOWN, ROUNDUP
| Syntax | ||
| =ROUND(number,num_digits) =ROUNDDOWN(number,num_digits) =ROUNDUP(number,num_digits) |
||
| Purpose / Description | ||
| Returns a value that is a number rounded to a given number of significant digits. ROUND half-adjusts, that is it rounds values with a truncated portion at or above ½ of the last preserved digit will be rounded up (away from zero), and those below will be rounded down (towards zero). ROUNDDOWN explicitly rounds down, and ROUNDUP explicitly rounds up. Note that for negative values, rounding-down is towards zero, and rounding-up is away from zero, the opposite of a mathematical definition of which numbers are higher or lower than the original value! | ||
| Arguments | ||
| Name | Type | Description |
| number | number | A reference or nested expression that returns a valid reference, a constant or a nested expression that returns a numeric value to be rounded. Normal coercion rules apply, so if a text string or a logical value is passed, they will be coerced to a number if possible. Will accept an array of values to round. |
| num_digits | number | A reference or nested expression that returns a valid reference, a constant or a nested expression that returns a numeric value to specify the number of digits to the right (or left if negative) of the decimal place in the rounded result(s). Normal coercion rules apply, so if a text string or a logical value is passed, they will be coerced to a number if possible. Will accept an array of values to round. If the value of num_digits is negative, the rounding occurs to the left of the decimal, if the value of num_digits is positive, the rounding occurs to the right of the decimal, and for a num_digits value of 0, whole number rounding occurs. |
| Return Values | ||
| Type | Specific Value | Description |
| number | Returns the rounded result, in which the precision of the value matches that given by the num_digits argument. | |
| error | #VALUE! | If the value of either number or num_digits is not a number and is not capable of coercion to a number. |
| error | Any errors referenced by arguments are returned due to propagation of error values. | |
| Notes / Comments / Advice / Warnings | ||
| Comment: | The ability to round to the left of the decimal is extremely useful in a range of modelling and reporting tasks where the decimal precision needs to be managed. | |
| Comment: | An alternative to ROUNDDOWN is the TRUNC function. | |
| Examples: | Open / download sample workbook: ROUND, ROUNDDOWN, ROUNDUP.xlsx | |