ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   how to get a range of cells rounded off to the nearest value? (https://www.excelbanter.com/excel-discussion-misc-queries/448508-how-get-range-cells-rounded-off-nearest-value.html)

sumesh56

how to get a range of cells rounded off to the nearest value?
 
i have the following data in cells A2:E2. (14.1,25,26.8,17.9,,48.6) i want to get the figures without the decimals. i tried the following with negative result.
=Round(A2:E2,0)
i can get the required result in three steps
1.=Sum(A2:E2,0) gives me the result with one decimal
2.select cell at the top and click on the ribbon to reduce the decimal to nil.
3. use the fill handle
is it possible to accomplish the task with one formula? thanks

Spencer101

Quote:

Originally Posted by sumesh56 (Post 1610768)
i have the following data in cells A2:E2. (14.1,25,26.8,17.9,,48.6) i want to get the figures without the decimals. i tried the following with negative result.
=Round(A2:E2,0)
i can get the required result in three steps
1.=Sum(A2:E2,0) gives me the result with one decimal
2.select cell at the top and click on the ribbon to reduce the decimal to nil.
3. use the fill handle
is it possible to accomplish the task with one formula? thanks

Use round on single cells rather that the range.
So, =ROUND(A2,0) and drag/copy across.

If these cells show as having a decimal place but all of those are zero, then it's formatting rather than the formula not working.

Also worth considering ROUNDDOWN / ROUNDUP depending on how ou need the results. 17.9 for example wold become 18 with ROUND or ROUNDUP, but 17 with ROUNDDOWN.

Kevin@Radstock

Hi sumesh56

Or summing the interger (Without rounding)
=SUMPRODUCT(INT(A2:E2))

Quote:

Originally Posted by sumesh56 (Post 1610768)
i have the following data in cells A2:E2. (14.1,25,26.8,17.9,,48.6) i want to get the figures without the decimals. i tried the following with negative result.
=Round(A2:E2,0)
i can get the required result in three steps
1.=Sum(A2:E2,0) gives me the result with one decimal
2.select cell at the top and click on the ribbon to reduce the decimal to nil.
3. use the fill handle
is it possible to accomplish the task with one formula? thanks


sumesh56

Quote:

Originally Posted by Spencer101 (Post 1610771)
Use round on single cells rather that the range.
So, =ROUND(A2,0) and drag/copy across.

If these cells show as having a decimal place but all of those are zero, then it's formatting rather than the formula not working.

Also worth considering ROUNDDOWN / ROUNDUP depending on how ou need the results. 17.9 for example wold become 18 with ROUND or ROUNDUP, but 17 with ROUNDDOWN.

thanks for the guidance. have a nice day.


All times are GMT +1. The time now is 01:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com