Excel ROUNDUP Function
The Excel ROUNDUP function returns a number that is rounded up in accordance with the specified number of digits
Example: Excel ROUNDUP Function
=ROUNDUP(B5,2)
|
Result in cell D5 (5378.73) - returns a number rounded up to the right of the decimal point by two.
|
=ROUNDUP(B6,0)
|
Result in cell D6 (5379) - returns a number rounded up to the nearest integer.
|
=ROUNDUP(B7,-2)
|
Result in cell D7 (5400) - returns a number rounded up to the left of the decimal point by two.
|
METHOD 2. Excel ROUNDUP Function using links
EXCEL
=ROUNDUP(B5,C5)
|
Result in cell D5 (5378.73) - returns a number rounded up to the right of the decimal point by two.
|
=ROUNDUP(B6,C6)
|
Result in cell D6 (5379) - returns a number rounded up to the nearest integer.
|
=ROUNDUP(B7,C7)
|
Result in cell D7 (5400) - returns a number rounded up to the left of the decimal point by two.
|
METHOD 3. Excel ROUNDUP function using the Excel built-in function library with hardcoded values
EXCEL
=ROUNDUP(B5,2) Note: in this example we are rounding up a number in cell (B5) to the right of the decimal point by two. |
METHOD 4. Excel ROUNDUP function using the Excel built-in function library with links
EXCEL
=ROUNDUP(B5,C5) Note: in this example we are rounding up a number in cell (B5) to the right of the decimal point by the amount in cell (C5). |
Dim ws As Worksheet
ws.Range("D5") = Application.WorksheetFunction.RoundUp(ws.Range("B5"), 2)
ws.Range("D6") = Application.WorksheetFunction.RoundUp(ws.Range("B6"), 0)
ws.Range("D7") = Application.WorksheetFunction.RoundUp(ws.Range("B7"), -2)
End Sub
Worksheets: The Worksheets object represents all of the worksheets in a workbook, excluding chart sheets.
Range: The Range object is a representation of a single cell or a range of cells in a worksheet.
Worksheet Name: Have a worksheet named ROUNDUP.
Value to Round Up: Ensure that the value that you want to round up is captured in range ("B5:B7").
ADJUSTABLE PARAMETERS
Output Range: Select the output range by changing the cell references ("D5"), ("D6") and ("D7") in the VBA code to any cell in the worksheet, that doesn't conflict with the formula.
Value to Round Up: Select the value that you want to round up by changing the range ("B5:B7") to any range in the worksheet that contains the values that you want to round up and doesn't conflict with the formula.
Dim ws As Worksheet
ws.Range("D5") = Application.WorksheetFunction.RoundUp(ws.Range("B5"), ws.Range("C5"))
ws.Range("D6") = Application.WorksheetFunction.RoundUp(ws.Range("B6"), ws.Range("C6"))
ws.Range("D7") = Application.WorksheetFunction.RoundUp(ws.Range("B7"), ws.Range("C7"))
End Sub
Worksheets: The Worksheets object represents all of the worksheets in a workbook, excluding chart sheets.
Range: The Range object is a representation of a single cell or a range of cells in a worksheet.
Worksheet Name: Have a worksheet named ROUNDUP.
Value to Round Up: Ensure that the value that you want to round up is captured in range ("B5:B7").
ADJUSTABLE PARAMETERS
Output Range: Select the output range by changing the cell references ("D5"), ("D6") and ("D7") in the VBA code to any cell in the worksheet, that doesn't conflict with the formula.
Value to Round Up: Select the value that you want to round up by changing the range ("B5:B7") to any range in the worksheet that contains the values that you want to round up and doesn't conflict with the formula.
Number of Digits: Select the number of digits to which the specified number should be rounded up to by changing the range ("C5:C7") to any range that contains a value that represents the number of digits to which the specified number should be rounded up to.
The Excel ROUNDUP function returns a number that is rounded up in accordance with the specified number of digits. Therefore, the function will round up any number that is greater than 0 (1-9).
=ROUNDUP(number, num_digits)
number: (Required) The number that is to be rounded up.
num_digits: (Required) The number of digits that the specified number will be rounded up to.
ADDITIONAL NOTES
Note 1: The ROUNDUP function can round up to the right or left of the decimal point.
Note 2: To round up to the right of the decimal point, enter a positive num_digits number.
Note 3: To round up to the left of the decimal point, enter a negative num_digits number.
Note 4: Using a 0 as the number_digits number, the ROUNDUP function will round up to the nearest integer.