+ Reply to Thread
Results 1 to 10 of 10

IF statement using multiple cells. Result should consider whether cells are blank

  1. #1
    Registered User
    Join Date
    12-22-2014
    Location
    NY, NY
    MS-Off Ver
    Excel 2010 Plus
    Posts
    4

    Post IF statement using multiple cells. Result should consider whether cells are blank

    I have an excel worksheet with 3 columns A, B and C.
    Columns A and B may or may not contain a value and Column C is populated with an IF statement which evaluates the values in Columns A and B
    and then populates C with text based on the results of the IF. A sample worksheet is attached which shows the details.

    What I am trying to accomplish is this:

    1) If Columns A and B both contain a value and those values are the same, the IF statement should populate Column C with "OK".
    2) If Columns A and B both contain a value and those values are the same after the UPPER function is applied to both values, the IF statement should populate Column C with "OK".
    3) If Columns A and B both contain a value but those values are not the same, the IF statement should populate Column C with "Review".

    The IF statement I am currently using in Column C is working correctly for these 3 scenarios.
    =IF(AND(NOT(ISBLANK(A2)),NOT(ISBLANK(B2))), IF(UPPER(A2) = UPPER(B2), "OK","Review"),"")


    Where it starts to not work correctly is when either Column A and/or B does not contain a value.
    Currently if either A or B do not contain a value, Column C is blank and I want it to contain "Review"

    So I need to fix the IF statement to work for the following scenarios as well.

    4) If Column A or B do not contain a value, the IF statement should populate Column C with "Review".
    5) If Column A and B are both blank, Column C should also be blank

    Any help or suggestions would be greatly appreciated.

    Thanks.
    Attached Files Attached Files

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: IF statement using multiple cells. Result should consider whether cells are blank

    Hello and welcome to the forum.

    Try this in C2:

    =IF(A2="",IF(B2<>"","Review",""),IF(A2=B2,"OK","Review"))

  3. #3
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: IF statement using multiple cells. Result should consider whether cells are blank

    Maybe: =IF(AND(A2="",B2="",),"",IF(OR(AND(A2="",B2<>""),AND(A2<>"",B2="")),"Review",IF(AND(NOT(ISBLANK(A2)),NOT(ISBLANK(B2))),IF(UPPER(A2)=UPPER(B2),"OK","Review"),"")))
    Click the * to say thanks.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,368

    Re: IF statement using multiple cells. Result should consider whether cells are blank

    Welcome to the forum.

    Try this:

    =IF(AND(A2="",B2<>""),"Review",IF(AND(A2="",B2=""),"",IF(A3=B3,"OK","NOT OK")))

    Excel doesn't care about the case of text it is comparing.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    12-22-2014
    Location
    NY, NY
    MS-Off Ver
    Excel 2010 Plus
    Posts
    4

    Re: IF statement using multiple cells. Result should consider whether cells are blank

    63falcondude,

    Works perfectly, thanks so much!
    I thought the answer was going to be more complicated than that.
    Last edited by harrysolomon; 08-13-2019 at 12:34 PM.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,368

    Re: IF statement using multiple cells. Result should consider whether cells are blank

    Which one? You got three options!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  7. #7
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: IF statement using multiple cells. Result should consider whether cells are blank

    You're welcome. Happy to help.

    Thanks for the rep!

  8. #8
    Registered User
    Join Date
    12-22-2014
    Location
    NY, NY
    MS-Off Ver
    Excel 2010 Plus
    Posts
    4

    Re: IF statement using multiple cells. Result should consider whether cells are blank

    AliGW,

    Sorry, I just updated my reply and will mark the thread as Solved.

    Thanks.
    Last edited by harrysolomon; 08-13-2019 at 12:36 PM.

  9. #9
    Registered User
    Join Date
    12-22-2014
    Location
    NY, NY
    MS-Off Ver
    Excel 2010 Plus
    Posts
    4

    Re: IF statement using multiple cells. Result should consider whether cells are blank

    AliGW,

    I didn't know that Excel doesn't care about the case of text when doing a compare.
    I thought I would need to use the UPPER function first.

    Good to know for the future, thanks.

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,368

    Re: IF statement using multiple cells. Result should consider whether cells are blank

    Glad to have helped.

+ 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] Nested If statement, checking multiple cells for Blank cells
    By JLeague in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-30-2015, 11:18 AM
  2. [SOLVED] Multiple cells blank using formula for result
    By Christopherdj in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-24-2014, 06:36 PM
  3. IF Statement to leave cell blank if multiple cells are all blank
    By sweeteri in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-14-2014, 12:02 PM
  4. Replies: 5
    Last Post: 08-26-2013, 06:26 PM
  5. [SOLVED] If two cells are blank, if statement to show third statement is blank
    By juliewoo in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-20-2013, 12:28 PM
  6. Count Blank Cells and Sse Result as Variable
    By Frenchie321 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-20-2011, 09:20 PM
  7. Replies: 3
    Last Post: 11-22-2007, 07:53 AM

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