+ Reply to Thread
Results 1 to 6 of 6

compare the cells if not blank

  1. #1
    Registered User
    Join Date
    07-13-2015
    Location
    hong kong
    MS-Off Ver
    ms 2010
    Posts
    16

    compare the cells if not blank

    123.png


    I want to have the final results as shown in column F. The conditions are as follows:

    If B2 or C2 is not blank, check whether D2=B2 or E2=C2 and return "Y" if D2<>B2 or E2<>C2.

    I have tried many formulas but they did not end up what I wanted. Please help. Thanks.
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,678

    Re: compare the cells if not blank

    Use:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and copy down
    Best Regards,

    Kaper

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,496

    Re: compare the cells if not blank

    Quote Originally Posted by Kaper View Post
    Use:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and copy down
    It should work with one more criteria
    Please Login or Register  to view this content.
    Quang PT

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,678

    Re: compare the cells if not blank

    I don't think so.
    In my opinion the logic behind is like this:
    Check if Fixed date or time is given. If not - ignore scheduled date and time even if it's set.
    Only if Fixed date or time is given, then check respective scheduled date or time: if it's the same do nothing, if different - display Y for reminder

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,496

    Re: compare the cells if not blank

    Quote Originally Posted by Kaper View Post
    Only if Fixed date or time is given, then check respective scheduled date or time: if it's the same do nothing, if different - display Y for reminder
    Just guessing until getting final instruction from OP
    Your logic are moving forward: Fix then Schedule.
    How about backward: Schedule then Fix?
    For instant: If, fixed date and time is set (B and C is occupied), but D and E is blank.
    Yours returns "Y" while it should not.

  6. #6
    Registered User
    Join Date
    07-13-2015
    Location
    hong kong
    MS-Off Ver
    ms 2010
    Posts
    16

    Re: compare the cells if not blank

    Quote Originally Posted by Kaper View Post
    I don't think so.
    In my opinion the logic behind is like this:
    Check if Fixed date or time is given. If not - ignore scheduled date and time even if it's set.
    Only if Fixed date or time is given, then check respective scheduled date or time: if it's the same do nothing, if different - display Y for reminder
    Yes, this is what I meant. I wanted to check D & E against B & C. If B & C are blank, I don't need to do the checking.
    I tried this formula before but putting " " instead of "". That's why it did not end up what I wanted.
    If I twists bebo021999's formula a bit, it can filter one more criteria: =IF(OR(AND(B2<>"",D2<>"No lesson",B2<>D2),AND(C2<>"",E2<>"",C2<>E2)),"Y","")

    Thanks Kaper and bebo021999.

+ 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. Compare two columns by inserting blank cells
    By sanjuss2 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-26-2018, 12:51 AM
  2. Count blank cells in a range and contiguous blank cells also as single cells! Tricky One!
    By SebastianColombia in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-31-2015, 02:32 PM
  3. [SOLVED] Compare 3 cells at the same time and ignore blank
    By stewegg in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 03-26-2015, 05:55 PM
  4. [SOLVED] Compare cells, If cell is blank move to next cell, ect
    By Mezinov in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-25-2014, 08:29 AM
  5. Compare two cells, if blank delete entire row
    By taichi56 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-03-2013, 02:05 PM
  6. Formula to compare if multiple cells no longer blank
    By pdauction in forum Excel General
    Replies: 2
    Last Post: 04-21-2011, 08:31 AM
  7. Macro to compare two cells, insert blank line, subtotal
    By odiebai in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-02-2010, 11:01 AM

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