# Display date differential as Years, Months and Days

#### Gary McMaster

##### Well-known Member
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

 * A B C D 1 Days Years Months Days 2 3804 10 5 4

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

 Cell Formula 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
Hi,

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

#### Gary McMaster

##### Well-known Member
Perfect. Thanks very much James

#### James006

##### Well-known Member

Thanks for the feedback ...

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.

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.

### Which adblocker are you using?

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

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