This is the sample dataset.
Method 1 – Dragging the Fill Handle Icon to Apply the ROUND Formula
Steps
- Select D5 and enter the following formula:
=ROUND(B5,0)
D5 displays the rounded version of the number in B5.
- Drag down the Fill Handle to the rest of the cells.
D5:D12 displays the rounded version of the numbers in B5:B12.
Method 2 – Embedding a VBA Macro to Round Multiple Cells in Excel
Steps
- Go to the Developer tab and click Visual Basic.
- Click Insert > Module
- In the Module window, enter the following code:
Sub Mul_round_formula()
Dim x As Range
Dim y As Range
Dim z As Integer
On Error Resume Next
xTitleId = "Enter Range of the Cells to be Rounded"
Set y = Application.Selection
Set y = Application.InputBox("Range", xTitleId, y.Address, Type:=8)
z = Application.InputBox("Decimal", xTitleId, Type:=1)
For Each x In y
x.Value = Application.WorksheetFunction.Round(x.Value, z)
Next
End Sub
- Close the window.
- Go to the View tab > Macros > View Macros.
- In View Macros, select the macro you created, here Mul_round_formula.
- Click Run.
- In the new window, enter the range you want to round, here $C$6:$C$12.
- Click OK.
- In the new window, enter 0, to make the number round to the closest integer.
- Click OK.
C5:C12 is rounded to the nearest integer.
Read More: How to Roundup a Formula Result in Excel
How to Round Multiple Cells without the ROUND Formula in Excel
Steps
- Copy the values in B5:B12 to D5:D12.
- Select the values and right-click.
- Click Format Cells.
- Select the Number tab and click Number.
- Set the Decimal places to 0.
- See the preview in Sample.
- Click OK.
The values in C5:C12 are rounded.
Download Practice Workbook
Download the practice workbook below.
Related Articles
- How to Round a Formula with SUM in Excel
- How to Round Percentages in Excel
- How to Set Rounding Precision in Excel
- How to Round a Multiplication Formula in Excel
- How to Round Numbers in Excel Without Formula
<< Go Back to Rounding in Excel | Number Format | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!