+ Reply to Thread
Results 1 to 4 of 4

Nested IF statement not displaying expected results

  1. #1
    Registered User
    Join Date
    04-28-2017
    Location
    Honolulu, HI
    MS-Off Ver
    2010
    Posts
    2

    Nested IF statement not displaying expected results

    I have the following code in cell E2
    A B C D E
    FALSE =IF(B2="FALSE","List1",IF(D2="FALSE","List2",""))

    Here's how I read that formula: If the word "FALSE" is in cell B2, then put "List1" in E2, if the word "FALSE" is not in cell B2, then check to see if the word "FALSE" is in cell D2. If it is in D2, then put "List2" in E2, if not, then put nothing in E2.

    Based on this, I'm expecting to see "List2" in E2 but instead E2 stays blank. So clearly my logic is wrong, but could someone help explain why and what I need to do to fix it? Thank you for looking.

  2. #2
    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
    52,929

    Re: Nested IF statement not displaying expected results

    In excel, FALSE (and TRUE) are reserved words, and are what gets returned from many functions. Try removing the "" from around the FALSE
    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

  3. #3
    Registered User
    Join Date
    04-28-2017
    Location
    Honolulu, HI
    MS-Off Ver
    2010
    Posts
    2

    Re: Nested IF statement not displaying expected results

    Perfect! Thank you!

  4. #4
    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
    52,929

    Re: Nested IF statement not displaying expected results

    Good stuff, happy to help and thanks for the feedback

+ 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] Macro results for time displaying different than expected
    By Worldbreaker in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-28-2017, 08:27 PM
  2. Replies: 2
    Last Post: 08-24-2014, 04:56 AM
  3. compile error expected line number statement end statement
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2014, 10:12 AM
  4. Replies: 4
    Last Post: 05-16-2012, 05:33 PM
  5. Date displaying as something different than expected
    By hattrick_123a in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-20-2011, 11:46 PM
  6. "IF" statement not giving expected results
    By khank in forum Excel General
    Replies: 6
    Last Post: 11-17-2010, 04:14 PM
  7. IF Statement not Displaying FILLDOWN results Automatically
    By CondtllyFrmttd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-16-2005, 04:05 PM

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