The function ROUNDUP rounds a number up to a given decimal place.
This function takes a two Numbers as input: a base number to round up, and another number describing which decimal place to round it to. It returns another Number: the given number, rounded up to the specified decimal place.
Declaration
ROUNDUP(base_number, digits) -> rounded_number
Parameters
base_number (required, type: Number)
The number to round.
digits (required, type: Number)
The decimal place to round to.
This specifies the number of digits that will trail the decimal point once rounding is complete. Giving 0 for the digits value results in ROUNDUP rounding the base number up to the nearest integer.
ROUNDUP also accepts negative numbers for digits, which specify how to round to a whole number: -1 means ROUNDUP will round the base number up to the ten's place, -2 means ROUNDUP will round the base number up to the hundred's place, -3 means ROUNDUP will round the base number up to the thousand's place, et cetera.
Return Values
rounded_number (type: Number)
The base number rounded up to the given decimal place.
Examples
The following example takes the the number 1. 5 and rounds it up to the nearest integer:
ROUNDUP(1.5, 0) -> 2
The following example takes the number 5.1101 and rounds it up to the nearest hundredth. Note that, despite the number occupying the thousandth place in the base number being 0 – the smallest number that could possibly occupy it – ROUNDUP still rounds up:
ROUNDUP(5.1101, 2) -> 5.12
The following example takes the number 31 and rounds it up to the nearest ten. Note again that the base number is rounded up to 40, despite 31 being much closer, in absolute terms, to 30 than 40:
ROUNDUP(31, -1) -> 40
Discussion
As demonstrated above, the ROUNDUP function only rounds up. Rounding in the more conventional manner – where whether to round up or down is determined by the rightmost number to the place being rounded to – the ROUND function is required. To exclusively round down instead of up, use ROUNDDOWN.