# Excel - between two dates

Dirty Dick 15:35 13 Feb 2007
Locked

I'm trying to set up a spreadsheet so that each time I open it, the time between two dates is calculated. The two dates would be today (the day I open the spreadsheet) and a date about 10 years away. Any help would be appreciated.

Thanx

DD

VoG II 15:41 13 Feb 2007

For example

in A1 30/03/2017

in B1 =TODAY()

in C1 =DATEDIF(B1,A1,"d")

JimT 16:13 13 Feb 2007

If you want to calculate the period between the two dates use the YEARFRAC function (ie fx on the Toolbar)

JimT

VoG II 16:25 13 Feb 2007

=DATEDIF(B1,A1,"y") & " Years " & DATEDIF(B1,A1,"ym") & " Months " & DATEDIF(B1,A1,"md") & " Days"

Dirty Dick 19:35 13 Feb 2007

VoG™ and JimT. Used the final one of VoGs™, and works superbly.

chocolate cake 21:11 13 Feb 2007

book

Migwell 00:44 14 Feb 2007

=now() in say A1
and the date you wish to equate from say A2

Dirty Dick 23:27 05 Feb 2008

.......... I seem to have a problem on my worksheet.

I have the formula...
=DATEDIF(Data!M2,C6,"y") & " Years " & DATEDIF(Data!M2,C6,"ym") & " Months " & DATEDIF(Data!M2,C6,"md") & " Days"

and in another cell (to calculate the "days" ...

= DATEDIF(Data!M2,C4,"d")

but on shows 29 days and the other shows 27 days.

Why is this?

Thanx again

DD

johnnyrocker 23:30 05 Feb 2008

advise you to start your own threadas this will not get looked at much cos of tick

johnny

VoG II 08:51 06 Feb 2008

What is in Data!M2, C6 and C4?

Dirty Dick 09:27 06 Feb 2008

In Data!M2 (on a seperate worksheet called Data) is the formaula for todays date { =TODAY() }

The other two cells I have copied from the wrong place and should be formula

=DATEDIF(Data!M2,C4,"y") & " Years " & DATEDIF(Data!M2,C4,"ym") & " Months " & DATEDIF(Data!M2,C4,"md") & " Days"

and

= DATEDIF(Data!M2,C4,"d")

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Xiaomi Mi Mix 2 review

See mcbess's iconic style animated for Mercedes-Benz

iPhone X news: Release date, price, new features & specs

Black Friday 2017 : date, sites participants & bonnes affaires