+ Reply to Thread
Results 1 to 12 of 12

IF formulas works on & off - returning 0 or (0)

  1. #1
    Registered User
    Join Date
    07-14-2011
    Location
    Charlotte, NC
    MS-Off Ver
    Excel 2003
    Posts
    6

    Smile IF formulas works on & off - returning 0 or (0)

    I have a simple IF formula - if the answer = 0 then return BALANCED, if not it should return the actual #. Here is the problem, some of the problems return the word BALANCED as it should, some are returing 0 or (0)?! I'm copying & pasting my formula so no room for error there?! I'll show you exactly the situation:

    A1 - enter #
    A2 - enter #
    A3 - (formula) +A1-A2
    A4 - enter #
    A5 - (formula) +A3-A4
    A6 - enter #
    A7 - (formula) =IF((+A5-A6)=0,"BALANCED",(+A5-A6))

    Again, sometimes it returns BALANCED but others it will return a 0 or even a (0).

    Please help

  2. #2
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: IF formulas works on & off - returning 0 or (0)

    Can you post a sample workbook showing your problem?
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  3. #3
    Registered User
    Join Date
    07-14-2011
    Location
    Charlotte, NC
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: IF formulas works on & off - returning 0 or (0)

    A1 10
    A2 3
    A3 7 Formula is +A1-A2
    A4 5
    A5 2 Formula is +A3-A4
    A6 2
    A7 BALANCED Formula is =IF((+A5-A6)=0,"BALANCED",(+A5-A6))


    Thanks davegugg

  4. #4
    Valued Forum Contributor Miraun's Avatar
    Join Date
    04-03-2009
    Location
    New England
    MS-Off Ver
    2003, 2007, 2010, 2013
    Posts
    554

    Re: IF formulas works on & off - returning 0 or (0)

    SRE;

    Without seeing the full sample workbook to see the problems you're describing, it's hard to determine the cause of the 0 value rather than "Balanced"...

    One thing that comes to mind is that the format on the individual cells is to round the values to whole numbers, while the numbers contained within the cell contain decimals. That would result in a .4 value difference between the two balances showing a 0 value, but still not being "Balanced".
    Going for Guru! Click the Star to the bottom left of this post if I helped!

  5. #5
    Registered User
    Join Date
    07-14-2011
    Location
    Charlotte, NC
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: IF formulas works on & off - returning 0 or (0)

    Miraun,

    The format was my thought as well, however, I don't know how to change it from not rounding (if that is the case)? I went in and formated all as a number, with a comma and decimal place 2.

    Any suggestions?

  6. #6
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: IF formulas works on & off - returning 0 or (0)

    How about posting a sample workbook?
    Post 3 does nothing to help us understand you problem because it doesn't show the issue you describe in your original post.

  7. #7
    Registered User
    Join Date
    07-14-2011
    Location
    Charlotte, NC
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: IF formulas works on & off - returning 0 or (0)

    Sorry I just joined today so I'm not sure how to go about posting a sample workbook?

  8. #8
    Valued Forum Contributor Miraun's Avatar
    Join Date
    04-03-2009
    Location
    New England
    MS-Off Ver
    2003, 2007, 2010, 2013
    Posts
    554

    Re: IF formulas works on & off - returning 0 or (0)

    You can always change the success criteria to being a less than 1 difference, if there are unknown decimals.

    =IF(abs((+A5-A6)<1),"BALANCED",(+A5-A6))

    However, that being said, if it's rounding, it may be possible to have over a 1 difference, even if the numbers appear to result in 0. I wouldn't be able to provide anymore insight to the formatting or rounding without seeing an example where it was showing 0, and not balanced.

  9. #9
    Registered User
    Join Date
    07-14-2011
    Location
    Charlotte, NC
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: IF formulas works on & off - returning 0 or (0)

    Where do I change the settings for rounding?

    Thanks

  10. #10
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: IF formulas works on & off - returning 0 or (0)

    Please see the forum rules, which describe how to attach a sample workbook.

  11. #11
    Registered User
    Join Date
    07-14-2011
    Location
    Charlotte, NC
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: IF formulas works on & off - returning 0 or (0)

    Here is my document, as you will see the 1st situation came out correct - BALANCED - this others have either a 0 or a (0)??

    Thanks
    Attached Files Attached Files

  12. #12
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: IF formulas works on & off - returning 0 or (0)

    This has to do with how Excel stores numbers. If you show more decimals, you will see the actual number in D14 is (0.0000000000146...) because the actual number in D10 is not a whole number either. To solve this, you could use the ROUND function and round it to two decimal places.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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