Use a cell to define amount of decimals for rounding numbers in a column

artsjeroen

New Member
Joined
Mar 18, 2014
Messages
5
I have an excel sheet where I type my numbers in C15:C20. The original numbers always have 3 decimals.
Sometimes all three decimals are necessary but other times I only need 1 decimal.

Is there a way to use a cell in the worksheet to define the amount of decimals to use in C15:C20
So that if I type 321.155 in cell C15 and in (for example "1" in C1) the amount in cell C15 is rounded to 321.2.

Any ideas?
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Yes its possible by using the round function....

=Round(C15,$C$1)

C15 is a multi digit decimal and C1 is the number of decimal places you want to round C15 to.
 
Upvote 0
For clarity you'd have to enter the formula in a cell other than C15, say D15.

To do it in the same cell your going to need a macro and some code. I don't do that stuff but their are some very clever people on here who do .
 
Upvote 0
Because it will be an secured worksheet. Colleagues can enter numbers, but can't alter anything else.
The amount of decimal places is different, according to the number itself.
(e.g, 1000.125 becomes 1000.1; 92.2564 becomes 92.256 and 0.12345 becomes 0.124 etc..)
 
Upvote 0
What's the criteria bywhich you determine which decimal length you need?

That will depend on the data, that's why I would like to use a cell to enter the amount of decimals used in the column.

It's laboratory data, so for example, if data is exact to 3 decimal places then we have to report 3 decimal places.
The data entered in the cells (C15:C20) will be entered with all decimal places as reported by the apparatus and then Excel should automatically alter it to the amount of decimals as defined in the cell.

Using formats is not sufficient for my purpose since the preciseness of the data is not consistent enough.
 
Upvote 0
Using =ROUND[] doesn't work either, since the data will be entered in the cells where the data has to be rounded.
So the formula would be overwritten.
 
Upvote 0

Forum statistics

Threads
1,214,830
Messages
6,121,839
Members
449,051
Latest member
excelquestion515

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top