Trying to compare two dates and print the most recent plus seven years

Phily50

New Member
Joined
Jul 8, 2013
Messages
28
Office Version
  1. 365
Platform
  1. Windows
I'm getting myself in all sorts of a muddle with this formula.

I have two dates - one in cell D8 and one in cell E8. I want to find the most recent date and then add seven years to it which will then put that new date into cell J8. The reason I have used the isblank and iserror is because there is blanks (obvs!) and also some cells contain n/k for not known.

I have adapted this formula from one that was working before that only looked at one date - it was working - but now I have added E8 it has to compare the two rather than just look at one.

I dont really want it to show 01/01/1900 if one of the cells is blank or says n/k


VBA Code:
=IF(ISBLANK(DATE(YEAR(MAX(E8,D8))+ 7)), MONTH(MAX(E8,D8), DAY(MAX(E8,D8))),"",IFERROR(DATE(YEAR(MAX(E8,D8D8)))) + 7, MONTH(MAX(E8,D8(D8), DAY(MAX(E8,D8(D8)),""))))

Grateful of any help from you guys as always.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Glad we could help & thanks for the feedback.
 
Upvote 0
Upvote 0
I think LET is only available in 365 versions. Older versions are not compatible with it.
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top