[Solved] Weird value 2.8422E-14 from column sum

Discuss the spreadsheet application
Locked
TheOldThug
Posts: 22
Joined: Fri Jun 12, 2020 3:03 pm

[Solved] Weird value 2.8422E-14 from column sum

Post by TheOldThug »

I copy another page and then Paste Special. This is the page. The other page I copy Has $0.00 in B56. It is the total of column B4:B53. For some reason I get this weird number in B56. Any idea why? The page I copy from Is format cell number as currency, negative number to 2 decimal spots.
Attachments
Test.ods
(15.48 KiB) Downloaded 62 times
Last edited by MrProgrammer on Thu Jun 20, 2024 4:32 pm, edited 3 times in total.
Reason: Edited topic's subject; Add ✓ to first post
Open Office 4.1.7 on Windows 10
FJCC
Moderator
Posts: 9624
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Weird Number

Post by FJCC »

It looks like you set Paste Special to not paste the cell format, so you get the result of the calculation, which is 0.000000000000028421709430404, displayed with maximum precision. That is displayed as 2.8422E-14. If you set the cell format to show only two decimal places, you will get the expected 0.00.
Computers can't store the exact value of many non-integer numbers, so you often get tiny residual values like this one. It's totally normal.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
TheOldThug
Posts: 22
Joined: Fri Jun 12, 2020 3:03 pm

Re: Weird Number

Post by TheOldThug »

OK ty. Weird though because been doing this all year and first time it ever happened
Open Office 4.1.7 on Windows 10
User avatar
MrProgrammer
Moderator
Posts: 5430
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: [Solved] Weird Number

Post by MrProgrammer »

TheOldThug wrote: Thu Jun 20, 2024 3:28 pm I copy another page and then Paste Special. The other page I copy Has $0.00 in B56. It is the total of column B4:B53. … The page I copy from Is format cell number as currency, negative number to 2 decimal spots.
If you paste the formats as well as the values you should see $0.00. We can't test because you didn't attach the other page.
Paste Special dialog
Paste Special dialog
202406200908.gif (18.83 KiB) Viewed 3550 times

Perhaps you want to use one of the rounding functions, for example =ROUND(SUM(B4:B53);2). It is common when working with dollars and cents to need values which are exact to two decimal places. You could use Precision As Shown if you have the correct format set for the cell.

TheOldThug wrote: Thu Jun 20, 2024 3:38 pm Weird though because been doing this all year and first time it ever happened
There are no doubt a hundred posts like this on the Calc forum. Your lucky day. You learned something new. You can also read about E notation which is very common with calculators and computers. It's been used since 1956.

[Tutorial] Ten concepts that every Calc user should know
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7.8, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
TheOldThug
Posts: 22
Joined: Fri Jun 12, 2020 3:03 pm

Re: [Solved] Weird value 2.8422E-14 from column sum

Post by TheOldThug »

Thank you for the input, very helpful and informative.
Open Office 4.1.7 on Windows 10
User avatar
robleyd
Moderator
Posts: 5505
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: [Solved] Weird value 2.8422E-14 from column sum

Post by robleyd »

For further detail you might find Calc: Accuracy problem helpful.
Slackware 15 (current) 64 bit
Apache OpenOffice 4.1.16
LibreOffice 26.2.3.2; SlackBuild for 26.2.3 by Eric Hameleers
---------------
I hate this damn computer, I wish that I could sell it.
It won't do what I want it to, Only what I tell it.
Locked