Round formula

RAJESH1960

Active Member
Joined
Mar 26, 2020
Messages
313
Office Version
  1. 2019
Platform
  1. Windows
Hello Everyone, Wish you a very Happy and Colorful Diwali.
I have a data here where I have to enter the data in columns A:J and K:Q are auto calculated. I tried the round function to get the auto calculations to round to 2 decimal points but as you see some columns are displaying more than 2 digits. I need someone to help me correct my mistake.?
Book2
ABCDEFGHIJKLMNOPQR
1Gross2.52.566995A12A18A512185A12A18Around off
2939890204.29204.2973.7273.7234.2034.2040549.208085.17380.008171.601228.67380.00810984.0067376.422111.110000000000000-0.590000000
32640.0062.8662.862514.400.000.000.000.000.000000000000000-0.120000000
46885.00163.94163.946557.600.000.000.000.000.000000000000000-0.480000000
552080.001013.731013.73485.11485.1134.2034.2040549.208085.17380.000.000.000.000000000000000-0.450000000
69152.00435.820.000.000.008716.400.000.000000000000000-0.220000000
76290.00149.76149.765990.400.000.000.000.000.0000000000000000.080000000
84600.00219.050.000.000.004381.000.000.000000000000000-0.050000000
9
Sheet1
Cell Formulas
RangeFormula
K2:K8K2=ROUND(B2/2.5*100,2)
L2:L8L2=ROUND(D2/6*100,2)
M2:M8M2=ROUND(F2/9*100,2)
N2:N8N2=ROUND(H2/5*100,2)
O2:O8O2=ROUND(I2/12*100,2)
P2:P8P2=ROUND(J2/18*100,2)
Q2:Q8Q2=ROUND(A2-SUM(B2:P2),2)
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
50,930
Office Version
  1. 365
Platform
  1. Windows
Once you have formatted the column, then it should not change unless you already have something in your code that is changing the format.
 
Solution

Some videos you may like

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
55,457
Office Version
  1. 365
Platform
  1. Windows
I can add those to the VBA code, But I was hoping to find if there was any other way to round the amount to exactly decimal places without writing that in the code.
If you do nothing, by default it will not show all those zeroes after the number like you see in columns P and Q.
The only way it shows all those extra decimals is if someone already re-formatted the column to show all those decimal places (it would NEVER show anything like that by default, someone must have done that).

If you click on any of those cells, and go to the cell formatting, you will see that someone set those decimal places to 15, or whatever it is.
 

RAJESH1960

Active Member
Joined
Mar 26, 2020
Messages
313
Office Version
  1. 2019
Platform
  1. Windows
Once you have formatted the column, then it should not change unless you already have something in your code that is changing the format.
Oh Yeah. I tried in a new sheet. Now it's working perfectly. Thanks Fluff.
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
55,457
Office Version
  1. 365
Platform
  1. Windows
Oh Yeah. I tried in a new sheet. Now it's working perfectly. Thanks Fluff.
Like I said, that is not the default the behavior.
Somewhere along the way, someone told it to show that many decimal places.
 

RAJESH1960

Active Member
Joined
Mar 26, 2020
Messages
313
Office Version
  1. 2019
Platform
  1. Windows
Like I said, that is not the default the behavior.
Somewhere along the way, someone told it to show that many decimal places.
Yes. I had overwritten the formula on the cell which I had written a different formula earlier and hence it was not showing the correct answer. I learnt something new. You have to clear all the cell first, to clear the old format then enter the formula.
 

Watch MrExcel Video

Forum statistics

Threads
1,118,887
Messages
5,574,837
Members
412,620
Latest member
sharma7s
Top