How to round a range of cells in Excel?
Supposing you have a range of numbers with several decimal places, and now you want to round them with two decimal places. Such as rounding 2.1054 to 2.11. How to round a range of cells in Excel quickly?
Classic Menu for Office: brings back classic menus to Office 2010 and 2013 (includes Office 365).
Office Tab: brings tabbed interface to Office as the use of web browser Chrome, Firefox and Internet Explorer.
You can use the formula ROUND (number, number-digits) to accomplish this task. For example, I have a range (A1:A10) need to be rounded. Please do as follows:
1. Click a blank cell C1 and input the formula: =ROUND (A1, 2), see screenshot:
2. Then press Enter key, and the value in cell A1 will be rounded to a number with two decimal places. Then drag the fill handle over the range of cells that you want to apply this formula. See screenshot:
3. As they are formulas, when you need to copy them to other cells, please paste as values.
With following VBA code, you can round a range of cells quickly.
1. Select the range you want to round.
2. Click Developer > Visual Basic, a new Microsoft Visual Basic for applications window will be displayed, click Insert > Module, and input the following code into the Module:
VBA: to round a range of cells to two decimal places
Sub RoundNum() 'Updateby20140128 Dim Rng As Range Dim WorkRng As Range Dim xNum As Integer On Error Resume Next xTitleId = "KutoolsforExcel" Set WorkRng = Application.Selection Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8) xNum = Application.InputBox("Decimal", xTitleId, Type:=1) For Each Rng In WorkRng Rng.Value = Application.WorksheetFunction.Round(Rng.Value, xNum) Next End Sub
3. Then click button to run the code. Select the range you want to round inton the pop-up diallog, See screenshot:
4. Click Ok, and then type the number of decimal you want in another dialog, see screenshot:
5. Click Ok. All of the cells have been rounded with two decimal places.
The Operation Tools of Kutools for Excel is a very handy tool can solve this problem quickly and comfortably.
If you have installed Kutools for Excel, please do as the following steps:
1. Select the range that you want to round.
2. Click Kutools > Operation > Operation Tools. See screenshot:
3. In the operation Tools dialog box, select Rounding from Operation, and insert number 2 in the Operand box (to round a range of cells with two decimal places). And you can see the results from the Preview Pane. See screenshot:
4. Then click OK or Apply. It will convert a range of values into numbers with two decimal places.
Note: If you want to create formulas as well, you can check Create formulas option. If the selected cells include formulas, and you don’t want to round the calculated results of formulas, please check Skip formula cells option.
- Change values in a cell range
- Add values to multiple cells
- Do exponential calculation to a range of cells
- Multiply a range cells by a number
- Divide a range of cells by a number
- subtract a number from a range of cells