Calculating the difference in dates

S

sonar

Problem solved by using the following coding

Cell A: =(DATEDIF(D9,NOW(),"y")*12+DATEDIF(D9,NOW(),"ym"))
Cell B: Cell A * (cell with the formula of 30 days per year / 12 month
to give 2.5 days per month)

This gives me:

converts years "y" into months by multiplying it by 12, and adding th
month "ym" already calculated.

Then I multiply the 2.5 by the total of months to give me amount o
days accrued.

Regars
Sona
 
M

Myrna Larson

That's an awful lot of work to avoid using "m" as the 3rd argument to DATADIF
<g>.
 
F

Flintstone

Try this:

In cell A1 is the start date, whatever date you choose.

In cell A2 is the number of days you want to add to the date in cel
A1

In cell A3 is this formula =DATE(YEAR(A1),MONTH(A1),DAY(A1)+A2)

In cell A4 is this formula =DATEDIF(A1,A2,"y") & " Yr "
DATEDIF(A1,A2,"ym") & " Mo " & DATEDIF(A1,A2,"md") & " Dy"

Cell A3 is the predicted date after adding cell A2.

Cell A4 computes the difference between cells A1 and A3 and is based o
a 365.25 day year, and twelve 30.4375 day month.

Remember twelve months in a year is a constant, where as a month is no
always 31 days, 30.4375 days is the average of one month in a twelv
month cycle. Just make sure all users understand the formula, "365.2
day year". (Trial & Error)

I hope this helps.

Fre
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top