+ Reply to Thread
Results 1 to 7 of 7

Formula equaling 0 but not displaying string

  1. #1
    Forum Contributor
    Join Date
    01-18-2013
    Location
    England
    MS-Off Ver
    2016 (Mac)
    Posts
    149

    Formula equaling 0 but not displaying string

    Hello everyone,

    In my spreadsheet I have an if formula that should be displaying "Balancing" is the calculation is equal to 0. Problem is the sums is equal to zero but the return is not displaying "Balancing" it is displaying 0.00.
    I have tried numerous solutions but to no avail? Rather than explain this formula any further I think it is easier to attach the spreadsheet.

    Thank you for any help : )
    Attached Files Attached Files

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

    Re: Formula equaling 0 but not displaying string

    It was easy. Excel can't count.

    =IF(ROUND(SUMIF(Accounts!$G$3:$G$2649,"Pension",Accounts!$I$3:$I$2649)-SUM(F19+F37+F55+F71+F89+F105+F121+F139+F155+F171+F187),2)=0,"Balancing",ROUND((SUMIF(Accounts!$G$3:$G$2649,"Pension",Accounts!$I$3:$I$2649)-SUM(F19+F37+F55+F71+F89+F105+F121+F139+F155+F171+F187)),2))

    See link:

    https://support.microsoft.com/en-gb/...sults-in-excel
    Attached Files Attached Files
    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

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,051

    Re: Formula equaling 0 but not displaying string

    The problem is a known "problem" with excel based how excel calcs using the floating point method. see here for a description
    https://en.wikipedia.org/wiki/Floating-point_arithmetic

    A quick way around this would be to use ROUNDUP, either in the formulas above, or
    =IF(ROUNDUP(L5,2)-ROUNDUP(L6,2)=0,"Balancing",L5-L6)

    Also, you could use this in L6
    =SUMIF(A:A,"Total",F:F)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Contributor
    Join Date
    01-18-2013
    Location
    England
    MS-Off Ver
    2016 (Mac)
    Posts
    149

    Re: Formula equaling 0 but not displaying string

    Brilliant, thank you very much. I tried trunc but that did not help. I expanded the numbers to see if there ware numbers further down the decimal but nope! Been pulling my hair out over this one...

  5. #5
    Forum Contributor
    Join Date
    01-18-2013
    Location
    England
    MS-Off Ver
    2016 (Mac)
    Posts
    149

    Re: Formula equaling 0 but not displaying string

    I will note this down and read the Wiki. I need to learn these things as it will happen to me again at some point : )

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,051

    Re: Formula equaling 0 but not displaying string

    Happy to help and thanks for the feedback

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,051

    Re: Formula equaling 0 but not displaying string

    On a side note, not sure if it would have made any difference, but I used roundUP rather than just round, to make sure they both got rounded the same way

+ 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. [SOLVED] Conditional format based on cell not equaling the results of a formula
    By sheila manchester in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-16-2015, 12:33 PM
  2. Table with a number equaling a formula.
    By Toniw in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-28-2013, 10:17 AM
  3. Replies: 2
    Last Post: 06-05-2013, 08:59 PM
  4. Replies: 2
    Last Post: 02-05-2013, 04:52 AM
  5. Replies: 1
    Last Post: 06-25-2012, 09:07 PM
  6. Formula equaling zero is not equal to 0
    By smninos in forum Excel General
    Replies: 5
    Last Post: 12-15-2009, 03:41 PM
  7. Equaling Columns
    By AHotel in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-26-2009, 03:19 PM

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