Forum Discussion
Excel Formula Help for $0.00 Value
KevinCommunitas wrote: `` I don't understand what is happening.``
Because D5 is not really zero. It is 0.00400000000000339 -- not even close.
The "0.00...00339" part is probably due to the so-called "floating-point error" (anomaly, not truly an "error"). That should be avoided by explicitly rounding a calculation (somewhere).
But the "0.004..." part is due to the underlying calculation. Calculations!C96 is truly zero. But Calculations!B96 is 0.00400000000000339. That might be avoided by the same explicit rounding, by accident. But whether or not it should be avoided, one way or another, is something only you can decide.
We probably cannot help you any further because the Calculations worksheet is password-protected.
Please "re-post" the Excel file without password-protected elements. And instead of a link to onedrive.live.com, attach the Excel file to the posting. Use the "browse" link at the bottom of the Reply pane.
- KevinCommunitasDec 20, 2021Copper Contributor
JoeUser2004 There we go!! It finally gave me the option to upload the file!! It's all been un-protected now.
- JoeUser2004Dec 20, 2021Bronze Contributor
Well, I'm sure that you can figure this out a lot faster than we can, since presumably you understand the calculations.
To begin with, the formula in Calculations!B96 breaks down as follows:
=(122.84-108.0081-0-8.5783-0-0-0-5.9296-0.32)-0
for
=('Vendor Sheet'!C5-Calculations!K96-Calculations!J96-Calculations!I96-Calculations!H96-G96-F96-E96-D96)-C96
My guess is: the calculations in K96, I96 and E96 should be explicitly rounded to 2 decimal places.
But K96 is =K93+K94, and K93 appears to be 99.09 exactly. (It actually is; but only by accident.)
OTOH, K94 is =K93*9%. Almost certainly, that should be =ROUND(K93*9%, 2) .
You can track down the calculation errors for I96 and E96.
Nevertheless, the formula in B96 should be:
=ROUND('Vendor Sheet'!C5-K96-J96-I96-H96-G96-F96-E96-D96-C96, 2)
That eliminates the "floating-point error".
In fact, you should do that for __all__ of your calculations that you expect to be accurate to some number of decimal places (always 2?).
PS.... Better: =ROUND('Vendor Sheet'!C5-SUM(C96:K96), 2)
Caveat.... Alternatively, someone might suggest setting the "Precision as displayed" option. I do __not_recommend__ that in general, and especially in your case -- at least, not without careful review of all of your calculations and cell formats. But if you choose to experiment, be sure to make a back-up copy of the Excel file before setting the option. Merely setting the option might change some constants unintentionally and irreversibly, if they are displayed with less precision on purpose.
- HansVogelaarDec 20, 2021MVP
- JoeUser2004Dec 20, 2021Bronze Contributor
HansVogelaar wrote: ``=ROUND(Calculations!B96+Calculations!C96,2)``
And yes, that should be done __as_well__.
But that alone is hardly the complete correct answer, except by accident.