Subtracting Two Dates

EDJC

New Member
Joined
Apr 4, 2008
Messages
18
I have two questions. What would the formula be for subtracting two dates to get the numbers of years, months? I cannot get my formula to work.

Also, can Excel take a telephone number such as (555)-555-5555 can place the phone number in another field such as 555-555-5555?

Thank you for any assistance you may offer, I appreciate it,
Ed
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Stormseed

Banned
Joined
Sep 18, 2006
Messages
3,274
Regarding your first question, you can use =DATEDIF("Start Date","End Date","y").

Note: You can mention "y" in order to get difference in years, "d" in order to get the difference in days and "m" to get the difference in months.
 
Upvote 0

EDJC

New Member
Joined
Apr 4, 2008
Messages
18
Stormseed, thank you for the prompt response. I used your formula of
=DATEDIF(F2,C8,Y) I have the two dates defined at dates. I get the error of #NAME?

Thank you.
 
Upvote 0

Stormseed

Banned
Joined
Sep 18, 2006
Messages
3,274
Which version of Excel do you use on your computer ?
 
Upvote 0

Mike Blackman

Well-known Member
Joined
Jun 8, 2007
Messages
2,494
Can you not just do a normal subtract?

=A1-B1

And format the cell to "yy" if you only want to return the year?
 
Upvote 0

snowblizz

Well-known Member
Joined
Mar 16, 2009
Messages
1,123
You need to put quote signs on the last variable i.e. "y" at least in 2007.
 
Upvote 0

Stormseed

Banned
Joined
Sep 18, 2006
Messages
3,274
The exact format would be:

=DATEDIF("Start Date","End Date","y") where the start date is the reference to cell with the Starting Date and End Date would be the reference to the cell and letter y for years, m for months and d for days whould be in double quotes.

Alternatively, can you please let us know if you want to find the difference between dates in the same year ?
 
Upvote 0

EDJC

New Member
Joined
Apr 4, 2008
Messages
18
I am using version Excel 2000.

I put the quotes on "Y", and it's still returning the error. I thought I could just do a normal subtract but it returns the following: 3/27/2009 - 3/27/2003 returns 2192.00

Mike, your answer to my second question worked GREAT. Thank you!

Ed
 
Upvote 0

Forum statistics

Threads
1,191,069
Messages
5,984,448
Members
439,888
Latest member
c3rberus

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