Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default How do I calculate exact difference between two dates in y,m,d.

I want to calculate the difference between two dates exactly in years, months
and days. Say between the dates 14-02-1980 to 28-02-1985. The difference is 5
years, 0 months and 14 days including both the starting and ending dates. But
excel does not give the exact answer. Pl help me.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,047
Default How do I calculate exact difference between two dates in y,m,d.

Hi Muhammad,

use the datedif function

=datedif(initial_date,final_date,"X")

X is
"Y" to see the diference in years
"M" to see the diference in months
"D" to see the diference in days
"MD" to see the diference but, months and years are ignorated
"YD" to see the diference but, days and years are ignorated

hth



--
regards from Brazil
Thanks in advance for your feedback.
Marcelo



"Muhammad Javaid Hassan" escreveu:

I want to calculate the difference between two dates exactly in years, months
and days. Say between the dates 14-02-1980 to 28-02-1985. The difference is 5
years, 0 months and 14 days including both the starting and ending dates. But
excel does not give the exact answer. Pl help me.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 256
Default How do I calculate exact difference between two dates in y,m,d.

Assuming that A2 contains the first date, and B2 contains the second,
try...

=DATEDIF(A2,B2,"y")

=DATEDIF(A2,B2,"ym")

=DATEDIF(A2,B2,"yd")

Hope this helps!

In article ,
Muhammad Javaid Hassan <Muhammad Javaid
wrote:

I want to calculate the difference between two dates exactly in years, months
and days. Say between the dates 14-02-1980 to 28-02-1985. The difference is 5
years, 0 months and 14 days including both the starting and ending dates. But
excel does not give the exact answer. Pl help me.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 256
Default How do I calculate exact difference between two dates in y,m,d.

Correction...

=DATEDIF(A2,B2,"yd")

should be

=DATEDIF(A2,B2,"md")

Hope this helps!

In article ,
Domenic wrote:

Assuming that A2 contains the first date, and B2 contains the second,
try...

=DATEDIF(A2,B2,"y")

=DATEDIF(A2,B2,"ym")

=DATEDIF(A2,B2,"yd")

Hope this helps!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
formula to obtain difference between two dates. Onkar Raut Excel Worksheet Functions 2 June 19th 06 08:36 AM
difference between dates dcccgoose Excel Discussion (Misc queries) 3 May 15th 06 03:34 AM
Formula to calculate number of days between Dates themax16 Excel Worksheet Functions 2 October 21st 05 01:38 PM
Difference between two dates in months with decimals effem Excel Worksheet Functions 3 November 5th 04 06:23 PM
calculate with dates before 1-1-1900 jan wan Excel Worksheet Functions 3 October 29th 04 10:54 PM


All times are GMT +1. The time now is 01:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"