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

1. ## 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. ## 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","")`

3. ## 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 ?

4. ## 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?

5. ## 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. ## 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","")`