Need a formula to calculate a date based on 2 other cells that have dates in them

Break977

New Member
Joined
Sep 22, 2016
Messages
10
[TABLE="width: 500"]
<tbody>[TR]
[TD]A1
[/TD]
[TD]A2
[/TD]
[TD]A3
[/TD]
[TD]A4
[/TD]
[/TR]
[TR]
[TD]01 Mar 2006
[/TD]
[TD]12 May 2011
[/TD]
[TD]01 May 2020
[/TD]
[TD]240/108
[/TD]
[/TR]
</tbody>[/TABLE]


So I need a formula in cell A3 that will produce a date based on the following:

A2-A1: if the answer (in months) is greater than 108, then cell A3 should be a date that is cell A2+108
A2-A1: if the answer (in months) is less than 108, then cell A3 should be a date that is cell A1+240

Let me know if you require any further information, hope I asked the question that is easily understandable.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
=IF(DATEDIF(A1,A2,"M")>108,EDATE(A2,108),EDATE(A1,240))

This formula check to see if the difference in months between A1 and A2 is greater than 108.
If the difference is greater than 108, the formula adds 108 months to the date in A2.
If the difference is less than or equal to 108 months, the formula adds 240 months to the date in A1.

The answer to your sample would then be 01 Mar 2026.
 
Upvote 0
=IF(DATEDIF(A1,A2,"M")>108,EDATE(A2,108),EDATE(A1,240))

This formula check to see if the difference in months between A1 and A2 is greater than 108.
If the difference is greater than 108, the formula adds 108 months to the date in A2.
If the difference is less than or equal to 108 months, the formula adds 240 months to the date in A1.

The answer to your sample would then be 01 Mar 2026.


So far, works perfect, just one last thing, how do I make the date (that is the outcome of this formula) always be the first of the month, ie. 01 Mar 2012 or 01 May 2023???

Thanks again.
 
Upvote 0
So far, works perfect, just one last thing, how do I make the date (that is the outcome of this formula) always be the first of the month, ie. 01 Mar 2012 or 01 May 2023???

Thanks again.

Try

=IF(DATEDIF(A1,A2,"M")>108,EDATE(A2,108)-DAY(EDATE(A2,108))+1,EDATE(A1,240)-DAY(EDATE(A1,240))+1)
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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