+ Reply to Thread
Results 1 to 11 of 11

Logical test in IF function returning TRUE when it should be FALSE

  1. #1
    Registered User
    Join Date
    11-28-2012
    Location
    Las Vegas
    MS-Off Ver
    Excel 2010
    Posts
    8

    Logical test in IF function returning TRUE when it should be FALSE

    My formula in cell C10 is: =IF(C7="Purchase",B10,""). C7 is currently blank, but the formula is calculating it as TRUE and inputting the value from B10. The Logical test is not TRUE, so what is going on?

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

    Re: Logical test in IF function returning TRUE when it should be FALSE

    no idea ,it should work perhaps c7 has some leading or trailing spaces or some other "invisible" character
    what do=CODE(LEFT(UPPER(C7))) and =CODE(RIGHT(UPPER(C7))) they should return 80 and 69 respectively
    "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

  3. #3
    Registered User
    Join Date
    11-28-2012
    Location
    Las Vegas
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Logical test in IF function returning TRUE when it should be FALSE

    I get a #VALUE with both of the left and right formulas.

  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: Logical test in IF function returning TRUE when it should be FALSE

    that is just wrong , put the word purchase in a spare cell then reference that with both formulas what do you get?

  5. #5
    Registered User
    Join Date
    11-28-2012
    Location
    Las Vegas
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Logical test in IF function returning TRUE when it should be FALSE

    I get the 80 and 69 now. I have this same formula in a new worksheet I just opened up and it works perfectly - I can't figure it out.

  6. #6
    Registered User
    Join Date
    11-28-2012
    Location
    Las Vegas
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Logical test in IF function returning TRUE when it should be FALSE

    If I enter in any kind of text or number into C7, then the logical test returns FALSE, as it should. Only when the cell is left blank, which is what I want to do, is it screwing up the formula.

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

    Re: Logical test in IF function returning TRUE when it should be FALSE

    ok #value if blank which is correct, and 80/69 when "purchase" is in cell . formula should work fine
    post a workbook where this isn't working(is calculation set to auto?)

  8. #8
    Forum Contributor Steve N.'s Avatar
    Join Date
    12-22-2011
    Location
    USA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    298

    Re: Logical test in IF function returning TRUE when it should be FALSE

    Select the offending cell, and only that cell, and use 'Clear All'. That should remove any stray stuff. You can also use the 'Clean' function to remove unprintable characters or the 'Trim' function to remove stray spaces in a cell.

    Hope that helps...

  9. #9
    Registered User
    Join Date
    11-28-2012
    Location
    Las Vegas
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Logical test in IF function returning TRUE when it should be FALSE

    Quote Originally Posted by martindwilson View Post
    ok #value if blank which is correct, and 80/69 when "purchase" is in cell . formula should work fine
    post a workbook where this isn't working(is calculation set to auto?)
    Workbook is attached.
    Attached Files Attached Files

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

    Re: Logical test in IF function returning TRUE when it should be FALSE

    for some reason you have transition formula evaluation turned on in options
    Excel 2010 Options > Advanced > and then uncheck Transition formula evaluation.(under lotus compatibility settings)
    Last edited by martindwilson; 11-28-2012 at 05:08 PM.

  11. #11
    Registered User
    Join Date
    11-28-2012
    Location
    Las Vegas
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Logical test in IF function returning TRUE when it should be FALSE

    THANK YOU! I have no idea what that is, but it's fixed and the formula works.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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