+ Reply to Thread
Results 1 to 7 of 7

If two cells are blank, if statement to show third statement is blank

  1. #1
    Registered User
    Join Date
    02-08-2010
    Location
    Seattle, Washington
    MS-Off Ver
    Excel 2003
    Posts
    2

    If two cells are blank, if statement to show third statement is blank

    I'm working on a spreadsheet to compare data between two cells in multiple rows.

    In my "if statement, If the cells are the same, I'd like a "yes" response, and if they are different, I'd like a "no" response. I'm running into difficulty because if the cells are both blank, I'm getting a "yes" response and I'd like that response to be blank.

    Any thoughts would be greatly appreciated!

  2. #2
    Administrator JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: If two cells are blank, if statement to show third statement is blank

    How about:

    =IF(COUNTA(A1,B1)<2, "", IF(A1=B1, "Yes", "No"))
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

  3. #3
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161

    Re: If two cells are blank, if statement to show third statement is blank

    You could also try this:
    =IF(AND(ISBLANK(A1),ISBLANK(B1)),"",IF(A1<>B1, "No", "Yes"))
    Not all forums are the same - seek and you shall find

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    21,528

    Re: If two cells are blank, if statement to show third statement is blank

    If A1 & B1 can contain formula Nulls COUNTBLANK is perhaps the safest option of all given Nulls are seen as Blanks (not the case with COUNTA / ISBLANK)

    =IF(COUNTBLANK(A1:B1)=2,"",IF(A1=B1,"Yes","No"))

  5. #5
    Registered User
    Join Date
    02-08-2010
    Location
    Seattle, Washington
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: If two cells are blank, if statement to show third statement is blank

    Thank you all very much!
    I used the first suggestion and it worked, but I have printed them all out to have on hand.
    Really appreciate the help.

  6. #6
    Administrator JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: If two cells are blank, if statement to show third statement is blank

    If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].


    (Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated. It is found across from the "time" in each of our posts.)

  7. #7
    Registered User
    Join Date
    04-15-2013
    Location
    Boston
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: If two cells are blank, if statement to show third statement is blank

    Recycled. Thank you, not exactly what I needed but enough to make it work.
    =IF(AND(ISBLANK(A35221),ISBLANK(L35221)),"",IF(L35221="","0",IF(L35221<0,"Overdue","Not Overdue")))

+ 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