Display date differential as Years, Months and Days

Gary McMaster

Well-known Member
Joined
Feb 8, 2009
Messages
1,977
Hi Everyone,

Although it may not be the best way, I believe the formulas shown below return the correct number of years and months. Is there a simple way to return the number of days? Given leap years and non-30 day months, I'm sure cell D2 is way wrong.

Best regards,

Gary

Sheet2

*ABCD
1DaysYearsMonthsDays
238041054

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"></colgroup><tbody>
</tbody>

Spreadsheet Formulas
CellFormula
A2=DATEDIF("1/17/2005",NOW(),"D")
B2=DATEDIF("1/17/2005",NOW(),"y")
C2=(DATEDIF("1/17/2005",NOW(),"m")-(12*B2))
D2=A2-((365*B2)+(30*C2))

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

James006

Well-known Member
Joined
Apr 4, 2009
Messages
3,680
Hi,

As far as Datedif() is concerned ... you could use "ym" as argument for cell C2 and "md" for cell D2 ...
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,167,651
Messages
5,854,956
Members
431,689
Latest member
jacker01

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
Top