+ Reply to Thread
Results 1 to 8 of 8

Difference between two dates

  1. #1
    Registered User
    Join Date
    06-13-2012
    Location
    chennai
    MS-Off Ver
    Excel 2007
    Posts
    5

    Difference between two dates

    Hi experts,

    I am trying to calculate the dufference between two given dates,

    my date format is as follows,

    A1 = 12-mar-2012 12:05:30 PM
    B1 = 17-Jun-2012 02:06:35 AM

    Now i want to calculate month , days , hours between these two days (i.e like 2 months 27 days 8 hrs 1 min)

    how do i achive this?

    I have been tried with Custom number format dd:hh:mm (days,hours,mins), but it gives only days upto 31 days.

    Please help,

    Karthick
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    04-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    547

    Re: Difference between two dates

    If you calculate =B2-A2 then format the cell with a custom format, for example

    m "months", d "days" hh:mm:ss

    which, with your sample data will return: 3 months, 6 days 03:26:31
    Last edited by npamcpp; 06-13-2012 at 07:56 AM.
    Like a post? Click the star below it!

  3. #3
    Registered User
    Join Date
    06-13-2012
    Location
    chennai
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Difference between two dates

    Hi,
    Thanks for your valuable input.i tried the same but the result what I am getting not accurate.can u explain further

  4. #4
    Registered User
    Join Date
    05-31-2012
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Difference between two dates

    =DATEDIF(A1,B1,"y")&" YEAR "&DATEDIF(A1,B1,"ym")&" MONTHS "&DATEDIF(A1,B1,"md")
    &" DAYS"


    Try this Formula : Start Date:A1, End Date : B1. You will get duration between TWO dates in Year,Months and Days.

  5. #5
    Forum Contributor marc5354's Avatar
    Join Date
    11-10-2009
    Location
    India
    MS-Off Ver
    Excel 2003 & Excel 2007
    Posts
    217

    Re: Difference between two dates

    Hi Karthick,

    Please find attached sample workbook.

    Hope this will sort out your problem.

    Marc
    Attached Files Attached Files

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Difference between two dates

    This is marc5354's file from post #5 (which uses harish bajaj's suggestion from post #4) with npamcpp's suggestion from post #2 in cell D2.
    Attached Files Attached Files
    Last edited by Cutter; 06-13-2012 at 04:22 PM.

  7. #7
    Registered User
    Join Date
    06-13-2012
    Location
    chennai
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Difference between two dates

    Hi experts,

    Thanks again, Your solution works fine.

    But i also need to track the Hours & Minutes.Is there any formula which will accomodate this requirement?

    Please suggest.

    Thanks in advance,

    Karthick

  8. #8
    Registered User
    Join Date
    06-13-2012
    Location
    chennai
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Difference between two dates

    Hi,

    Your suggestion really helpful,

    But what about if the the difference exceeding a year. How to bring the year value?

    Thanks,

    Karthick

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1