+ Reply to Thread
Results 1 to 9 of 9

If and statement should = 0 instead of "true"

Hybrid View

  1. #1
    Forum Contributor jonvanwyk's Avatar
    Join Date
    06-28-2010
    Location
    Iowa, USA
    MS-Off Ver
    Excel 2010
    Posts
    452

    If and statement should = 0 instead of "true"

    =IF(AND(B5="FamSick",C5=1),B49+B89,0)

    In my spreadsheet right now, the value of B5 is 0:00 while the value of C5 is 3. With this being the case, B49 and B89 should not be added to create a result. (Even if they were added, both contain a value of 0 right now, so that value would still be 0.)

    Instead of the above forumla equalling 0, it is making it equal TRUE. Any ideas?

    P.S. The formula in this case is found in cell B155
    Attached Files Attached Files
    Last edited by jonvanwyk; 07-14-2010 at 04:24 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: If and statment should = 0 instead of "true"

    if you hit F9.. does it recalc properly?
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor jonvanwyk's Avatar
    Join Date
    06-28-2010
    Location
    Iowa, USA
    MS-Off Ver
    Excel 2010
    Posts
    452

    Re: If and statment should = 0 instead of "true"

    Quote Originally Posted by NBVC View Post
    if you hit F9.. does it recalc properly?
    Do I have to have anything selected when I hit F9? I had the cell selected that contains the above formula and nothing occurred.

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: If and statment should = 0 instead of "true"

    works ok for me
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Forum Contributor jonvanwyk's Avatar
    Join Date
    06-28-2010
    Location
    Iowa, USA
    MS-Off Ver
    Excel 2010
    Posts
    452

    Re: If and statment should = 0 instead of "true"

    Quote Originally Posted by martindwilson View Post
    works ok for me
    I edited the original post to include the excel file I am working from. Cell B155 is the cell that contains this particular formula.

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: If and statment should = 0 instead of "true"

    It doesn't matter the cell selected when hitting F9.. it should recalc the sheet.

    Are you sure about the cells you are referencing.. is it in fact B5 and C5 you are looking at?

    Maybe you can post the sheet.. it should work as is...

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: If and statment should = 0 instead of "true"

    You somehow put the same formula in the cell twice...

    Expand the formula bar to make it higher and you will see the formula twice in B155

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: If and statment should = 0 instead of "true"

    bi55 appears to strangely have 2 formulas in it! delete one of them
    i see nbvc has spotted that too!
    essentially its saying
    =IF(AND(B5="FamSick",C5=1),B49+B89,0)=IF(AND(B5="FamSick",C5=1),B49+B89,0)
    which they do hence true

  9. #9
    Forum Contributor jonvanwyk's Avatar
    Join Date
    06-28-2010
    Location
    Iowa, USA
    MS-Off Ver
    Excel 2010
    Posts
    452

    Re: If and statment should = 0 instead of "true"

    Quote Originally Posted by martindwilson View Post
    bi55 appears to strangely have 2 formulas in it! delete one of them
    i see nbvc has spotted that too!
    essentially its saying
    =IF(AND(B5="FamSick",C5=1),B49+B89,0)=IF(AND(B5="FamSick",C5=1),B49+B89,0)
    which they do hence true
    Thank you for noticing...both of you. I had a hard time even seeing it in there twice. It is now fixed and working!

+ 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