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
 

Some videos you may like

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

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 ...
 

Watch MrExcel Video

Forum statistics

Threads
1,122,657
Messages
5,597,391
Members
414,142
Latest member
Banyangt

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