calculate the difference between two dates all in one cell

happydz

New Member
Joined
Jan 11, 2017
Messages
41
Hi guys
I need to calculate the difference between two dates (Days/Months/Years) all in one cell, I tried the formula as shown in the screenshot, but it faild.
I have microsoft office excel 2007
I tried every trick I found on youtube, but none of them worked
It would be very helpful if you create a completed template (excel sheet.xls) so that I will find it easier to edit the dates
thank you in advance
nijv7pa.png
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Looks like you're missing a closing ) try
=IF(DATEDIF(A24,B24,"y")=0,"",DATEDIF(A24,B24,"y")&" Years")&IF(DATEDIF(A24,B24,"ym")=0,"",DATEDIF(A24,B24,"ym")&" Months")&IF(DATEDIF(A24,B24,"md")=0,"",DATEDIF(A24,B24,"md")&" Days")
 
Upvote 0
Works for me

Excel 2013 32 bit
ABC
104/05/200104/06/201514 Years 1 Months
204/05/200106/06/201514 Years 1 Months 2 Days
304/05/201507/06/20151 Months 3 Days
Sheet1
Cell Formulas
RangeFormula
C1=IF(DATEDIF(A1,B1,"y")=0,"",DATEDIF(A1,B1,"y")&" Years ")&IF(DATEDIF(A1,B1,"ym")=0,"",DATEDIF(A1,B1,"ym")&" Months ")&IF(DATEDIF(A1,B1,"md")=0,"",DATEDIF(A1,B1,"md")&" Days ")
 
Last edited:
Upvote 0
Ok, lets break it down
in D1 put =DATEDIF(A1,B1,"y")
in E1 put =DATEDIF(A1,B1,"ym")
in F1 put =DATEDIF(A1,B1,"md")
What do you get?
 
Upvote 0
Ok, lets break it down
in D1 put =DATEDIF(A1,B1,"y")
in E1 put =DATEDIF(A1,B1,"ym")
in F1 put =DATEDIF(A1,B1,"md")
What do you get?
ABCDEF
28-10-1717-11-170019

<tbody>
</tbody>
P.S: F1 the result should be (20 days) not (19 days)
 
Upvote 0
?? I Get 20 days
what if you use these dates
04/05/2001 06/06/2015
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,941
Members
449,094
Latest member
teemeren

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