Excel - Check if date is greater in 2 columns
Results 1 to 6 of 6

Thread: Excel - Check if date is greater in 2 columns
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Nov 2006
    Posts
    921
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Excel - Check if date is greater in 2 columns

    I have two columns with dates. Is it possible to check (with a single formula) that for each row, the date entered in column 2 is always greater than the date entered in column 1?

    many thanks

  2. #2
    MrExcel MVP
    Junior Admin
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    50,441
    Post Thanks / Like
    Mentioned
    54 Post(s)
    Tagged
    11 Thread(s)

    Default Re: Excel - Check if date is greater in 2 columns

    Try something like this:
    Code:
    =IF(SUMPRODUCT(--(B1:B4 < A1:A4))>0,"Values exist in column A greater than in column B","")
    Last edited by Joe4; Jul 12th, 2019 at 11:00 AM.
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

  3. #3
    Board Regular
    Join Date
    Nov 2006
    Posts
    921
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Excel - Check if date is greater in 2 columns

    ok this works but if the date is left blank it also gives an error... is there a way to skip blank cells ?
    Last edited by neodjandre; Jul 12th, 2019 at 04:06 PM.

  4. #4
    MrExcel MVP
    Junior Admin
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    50,441
    Post Thanks / Like
    Mentioned
    54 Post(s)
    Tagged
    11 Thread(s)

    Default Re: Excel - Check if date is greater in 2 columns

    Which columns would the blanks appear in?
    If there are any blanks, do you want to skip the whole function, or just the check in that row?
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

  5. #5
    Board Regular
    Join Date
    Nov 2006
    Posts
    921
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Excel - Check if date is greater in 2 columns

    so the second column could be blank or not... the first column always has a date... if both columns are blank then the check should be skipped for that row... essentially i am checking if the disposal date is greater than the purchase date.. the disposal date naturally should always be greater than the purchase date

  6. #6
    MrExcel MVP
    Junior Admin
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    50,441
    Post Thanks / Like
    Mentioned
    54 Post(s)
    Tagged
    11 Thread(s)

    Default Re: Excel - Check if date is greater in 2 columns

    Try this:
    Code:
    =IF(SUMPRODUCT(--(B1:B4 < A1:A4),--(B1:B4 > 0))>0,"Values exist in column A greater than in column B","")
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •