Home > OS >  Can't figure out why excel is rounding currency
Can't figure out why excel is rounding currency

Time:09-30

Here is my excel table:

Excel Hours worked multiplied by hourly

The cell with 8.83 = =((C8-B8)*24)-D8

*C8 = 4:50PM

*B8 = 7:30AM

*D8 = 0.50

The cell $371.00 = =(E8*B3)

Why does my total show $371.00 when B3 = $42? It should be $370.86. I don't have it set to round but for some reason it keeps on doing it.

CodePudding user response:

$371 is “technically” the correct amount, mathematically. You are actually doing rounding when you are hand-calculating your cross-check, and that isn’t matching Excel’s unfounded calculation.

( 4:50pm - 7:30am ) is 9.3333333 repeating, or “9-1/3”. Divided by 24 leaves you 8.8333333 repeating, not 8.83. Excel is doing what it’s supposed to do, and 371.00 is the correct amount. If your use case calls for times to be rounded to .01 hours and no further then you’ll need to apply rounding somewhere in cell E8.

CodePudding user response:

Because, the actual result of formula =((C8-B8)*24)-D8 is 8.833333333. Due to cell formatting you are seeing 8.83. If you want result for only two digit after decimal point then use round function like-

=ROUND(((C8-B8)*24)-D8,2)

Then you will get result 370.86. Or you can directly use in resulting cell.

=ROUND(E8,2)*B3
  • Related