Excel - Check if date is greater in 2 columns

neodjandre

Well-known Member
Joined
Nov 29, 2006
Messages
926
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
 

Some videos you may like

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
53,644
Office Version
365
Platform
Windows
Try something like this:
Code:
<b1:b100))>=IF(SUMPRODUCT(--(B1:B4 < A1:A4))>0,"Values exist in column A greater than in column B","")
</b1:b100))>
 
Last edited:

neodjandre

Well-known Member
Joined
Nov 29, 2006
Messages
926
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:

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
53,644
Office Version
365
Platform
Windows
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?
 

neodjandre

Well-known Member
Joined
Nov 29, 2006
Messages
926
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 :)
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
53,644
Office Version
365
Platform
Windows
Try this:
Code:
=IF(SUMPRODUCT(--(B1:B4 < A1:A4),--(B1:B4 > 0))>0,"Values exist in column A greater than in column B","")
 

Watch MrExcel Video

Forum statistics

Threads
1,102,133
Messages
5,484,911
Members
407,473
Latest member
Pam Sander

This Week's Hot Topics

  • Finding issue in If elseif else with For each Loop
    Finding issue in If elseif else with For each Loop I have tried this below code but i'm getting in Y column filled with W005. Colud you please...
  • MsgBox Error
    Hi Guys, I have the below error show up when i try and run my macro in File1 but works fine if i copy and paste the same code into file2. [ATTACH...
  • CELL FORMAT - IF CONDITION
    My Cell Format is [B]""0.00" Cr". [/B]But in the cell, it is showing 123.00 for editing. (123 is entry figure). (Data imported from other...
  • Show numbers nearly the same
    Is this possible. I have a number that can change very time eg 0.00001234 Then I have a lot of numbers 0.0000001, 0.0000002, 0.00000004...
  • Please i need your help to create formula
    I need a formula in cell B8 to do this >>if b1=1 then multiply ( cell b8) by 10% ,if b1=2 multiply by 20%,if=3 multiply by 30%. Thank you in...
  • Got error while adding column and filter
    Got error while adding column and filter In column Z has some like "Success" and "Error". I want to add column in AA if the Z cell value is...
Top