Round to the nearest ten

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

Example: Round to the nearest ten

Round to the nearest ten

METHOD 1. Round to the nearest ten

EXCEL

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

METHOD 1. Round to the nearest ten using VBA

VBA

Sub Round_to_nearest_ten()
'declare a variable
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'round a number to the nearest ten
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 ten 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 ten.
Worksheet Selection: Select the worksheet which captures the number that you want to round to the nearest ten 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 ten

EXPLANATION

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

RELATED TOPICS

Related Topic Description Related Topic and Description
How to round a number to the nearest hundred using Excel and VBA
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 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