SOLVED

Time calculation with decimal point issue

Copper Contributor

Good Day Team,

 

I am working on an Excel sheet that has daily time tracking of employees, and final summarized monthly tracking. I have set all my decimals as 2 decimal points, and I specified in Excel Advanced options to set (precision as displayed) so excel only makes its calculation based on the displayed 2 decimals.

 

Excel makes time calculation (from-to) and round it either up or down to make it 2 decimal places.

Everyday there is either a round up or a round down based on the actual value. 

 

However in the final tracking sheet we put the (first time in first day - last time in last day) so Excel makes on big subtraction, and then rounds it up or down.

 

The total time with 2 decimals in (Summed Dailies) is going to be different from the final calculation due to the fact that rounding was done many time during the month, whereas the final is done one only. 

 

Attached a sheet for example.

 

 

Is there any way around this? VBA code? 

Please note that I need 2 decimals at all time, and I need to set precision as displayed (mandatory) 

 

Hope you can support.

 

Thank you,

 

 

3 Replies

@Awfimohammed 

Rounding on two decimal places means rounding on 0.01*24*60 = about 15 minutes. Not sure that could be corrected if only to calculate final value independently of intermediate ones.

best response confirmed by Awfimohammed (Copper Contributor)
Solution

@Awfimohammed But that's not so strange. The first calculation (not rounded) results in 2.145833333 , thus, it becomes 2.15 rounded.

The other two calculations result in 0.29166666 and 1.85416666, which round to 0.29 and 1.85 respectively, adding up to 2.14

 

Perhaps you should use formulae like below to achieve what you need.

 

=ROUND(C6,2)-ROUND(B6,2)

 

 

@Riny_van_Eekelen 

 

This actually works very well for my calculations. Thank you so much sir. 

1 best response

Accepted Solutions
best response confirmed by Awfimohammed (Copper Contributor)
Solution

@Awfimohammed But that's not so strange. The first calculation (not rounded) results in 2.145833333 , thus, it becomes 2.15 rounded.

The other two calculations result in 0.29166666 and 1.85416666, which round to 0.29 and 1.85 respectively, adding up to 2.14

 

Perhaps you should use formulae like below to achieve what you need.

 

=ROUND(C6,2)-ROUND(B6,2)

 

 

View solution in original post