Round to the nearest hundred

This tutorial shows how to round a number to the nearest hundred through the use of Excel or VBA

Example: Round to the nearest hundred

Round to the nearest hundred

METHOD 1. Round to the nearest hundred

EXCEL

=ROUND(B5,C5)
This formula uses the Excel ROUND function to round the selected number in cell B5 to the nearest hundredth by using the value of -2 as the num_digit.

METHOD 1. Round to the nearest hundred using VBA

VBA

Sub Round_to_nearest_hundred()
'declare a variable
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'round a number to the nearest hundred
ws.Range("D5") = Application.WorksheetFunction.Round(ws.Range("B5"), ws.Range("C5"))

End Sub

ADJUSTABLE PARAMETERS
Output Range: Select the output range by changing the cell reference ("D5") in the VBA code.
Number to Round: Select the number that you want to round to the nearest hundred by changing the cell reference ("B5"), in the VBA code, to the cell that captures the number. Alternatively, you can change the number in cell ("B5") to the number that you want to round to the nearest hundred.
Worksheet Selection: Select the worksheet which captures the number that you want to round to the nearest hundred by changing the Analysis worksheet name in the VBA code. You can also change the name of this object variable, by changing the name 'ws' in the VBA code.

Explanation about the formula used to round to the nearest hundred

EXPLANATION

EXPLANATION
This tutorial shows how to round a number to the nearest hundredth through the use of Excel or VBA.
FORMULAS
=ROUND(number, -2)
ARGUMENTS
number: The number that is to be rounded to the nearest hundred.

RELATED TOPICS

Related Topic Description Related Topic and Description
How to round to the nearest thousand using Excel and VBA
How to round to the nearest million using Excel and VBA
How to round up a number using Excel and VBA
How to round a number to the nearest integer using Excel and VBA
How to round a number to two decimal places using Excel and VBA

RELATED FUNCTIONS

Related Functions Description Related Functions and Description
The Excel ROUND function returns a rounded number in accordance with the specified number of digits