+ Reply to Thread
Results 1 to 8 of 8

Excel can't handle Zero

  1. #1
    Registered User
    Join Date
    10-09-2017
    Location
    Stavanger, Norway
    MS-Off Ver
    O365
    Posts
    78

    Excel can't handle Zero

    If I enter 1 in a cell (A1), then in cell A2 add the formula (=A1-0.5) I get 0.95. If I then copy this formula down A3..A21 I would expect the value zero in cell A21, but I get -3,2E-16. This is very close to zero but is not zero. WHY is this happening. Why cannot Excel calculate zero

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Excel can't handle Zero

    Have a look here: https://www.microsoft.com/en-us/micr...wrong-answers/

    and here: https://www.spreadsheetweb.com/float...-issues-excel/
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    10-09-2017
    Location
    Stavanger, Norway
    MS-Off Ver
    O365
    Posts
    78

    Re: Excel can't handle Zero

    Many thanks... but I must say I'm none the wiser... anyway.. it's clear it's an excel problem.... I had thought perhaps it might have something to do with the Processor in my PC. I hope they don't use excel at NASA, calculating decent to the lunar surface would mean they'd crash

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,055

    Re: Excel can't handle Zero

    I doubt it!! Your washing machine probably has more processing power than Apollo 11 had!!! In all seriousness, don't run excel with more decimal places than are justified by your data. Don't change the formatting, as that does nothing to the underlying data. Use ROUND.
    Last edited by Glenn Kennedy; 08-22-2019 at 02:43 AM.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  5. #5
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: Excel can't handle Zero

    Please Login or Register  to view this content.
    Use this formula and cel A21 is exact zero
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  6. #6
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Excel can't handle Zero

    it's clear it's an excel problem.... I had thought perhaps it might have something to do with the Processor in my PC.
    Actually, your first thought was more correct -- it does have to do with the processor in your PC. Floating point arithmetic has been an inherent part of the way computers perform calculations since -- will Wikipedia claims that the first floating point "computer" was invented over 100 years ago in 1914. The modern floating point standards came together in the early 1980's, and, as far as I know, every modern computer and programming language implements floating point arithmetic. https://en.wikipedia.org/wiki/Floating_point#History

    The thing that surprises me about floating point error is not that it exists. Rather, I am frequently surprised at how many programmers seem completely unaware that this is how their processor performs arithmetic. We are supposed to be the most computer literate generation, and yet we seem blissfully unaware of this most fundamental part of how a computer works.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  7. #7
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Excel can't handle Zero

    Can I just add (no pun intended) that

    1-0.5 is 0.5

    "If I enter 1 in a cell (A1), then in cell A2 add the formula (=A1-0.5) I get 0.95"

    I presume the OP means 1-0.05
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  8. #8
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Excel can't handle Zero

    Quote Originally Posted by MrShorty View Post
    I am frequently surprised at how many programmers seem completely unaware that this is how their processor performs arithmetic. We are supposed to be the most computer literate generation, and yet we seem blissfully unaware of this most fundamental part of how a computer works.
    Computer literate can mean 'good at using a computer' or 'understands how the computer works' - most people fall into the first camp. I usually try to explain FP problems by using 2/3 as a basis for some simple calculations, but allowing only three decimal places - it soon goes 'wrong' obviously... (3 x 2/3 <> 3 x 0.667).
    That's before moving onto how everything in all computers is in binary, not b10, which just blows most people's minds...

    @Simon Campbell, sorry to hijack your thread!
    Regards,
    Aardigspook

    I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel VBA UDF To Handle Milliseconds
    By DD646 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-31-2017, 08:39 AM
  2. Tab Key handle in excel VBA
    By sanguapkar in forum Excel General
    Replies: 0
    Last Post: 12-12-2012, 07:32 AM
  3. Handle more than excel sheet at once . . .
    By eng_mohammedmostafa in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 03-02-2011, 08:41 AM
  4. Can excel handle more than 256 columns?
    By Nodles in forum Excel General
    Replies: 1
    Last Post: 12-06-2005, 07:35 AM
  5. [SOLVED] Excel should handle more than 65,536 rows.
    By colekp in forum Excel General
    Replies: 2
    Last Post: 09-26-2005, 11:05 AM
  6. Too much to handle for Excel?
    By Bart Snel in forum Excel General
    Replies: 3
    Last Post: 05-19-2005, 09:06 AM
  7. Replies: 1
    Last Post: 02-20-2005, 10:06 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1