+ Reply to Thread
Results 1 to 6 of 6

Formula equaling zero is not equal to 0

  1. #1
    Registered User
    Join Date
    07-29-2008
    Location
    FL
    MS-Off Ver
    XL 2007 & 2008
    Posts
    27

    Formula equaling zero is not equal to 0

    I have a simple formula which subtracts one cell from another. I then have an if and statement which checks if that cell is equal to zero. If so, continue processing. The problem is that the formula always reads the cell as not equal to zero although the result of the formula contained in the cell does result in zero.
    Attached Files Attached Files
    Last edited by smninos; 12-15-2009 at 03:41 PM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,042

    Re: Formula equaling zero is not equal to 0

    Actually H2<>0 checks is cell NOT equat to zero.

    Since it's 0 you'll always get empty cell, no matter on other issue
    Never use Merged Cells in Excel

  3. #3
    Registered User
    Join Date
    07-29-2008
    Location
    FL
    MS-Off Ver
    XL 2007 & 2008
    Posts
    27

    Re: Formula equaling zero is not equal to 0

    Maybe I worded my question incorrectly...

    =IF(AND(TODAY()>D2,H2<>0),"Past Due","")

    If D2 is greater than today AND H2 is not = to 0, then enter "Past Due" into the cell.

    The problem is that H2 contains a formula and always appears to contain a value greater than 0 although the result of the formula in H2 is 0.

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Formula equaling zero is not equal to 0

    You have your logic backwards, I think. h2<>0 will give a false value when you have 0 in H2, thus triggering your second argument. Is that what you want? If so, I tried a couple of scenarios (H2 neg, positive and 0) and they all worked as per the logic.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  5. #5
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: Formula equaling zero is not equal to 0

    When I open the workbook, H2 is 0 because E2=G2. If you change G2 to any other number, your formula works fine. If you want it to return "Past Due" if H2 is blank, simply change <>0 to <>"".

  6. #6
    Registered User
    Join Date
    07-29-2008
    Location
    FL
    MS-Off Ver
    XL 2007 & 2008
    Posts
    27

    Re: Formula equaling zero is not equal to 0

    Thanks darkyam.... sometimes the obvious isn't so

+ 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