Difference between two date

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Tapan Bera
    New Member
    • Jul 2007
    • 8

    Difference between two date

    Hi,

    I have a big problem with Date function in Excel.
    I need to find out the difference between two date.
    Suppose, one baby was born in 10th Feb 2000.
    What will be his age now (Yr- Month-Day).

    Please help.
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, Tapan.

    I'm going to go ahead and move this thread to the Windows forum, where one of our resident Experts will be more likely to see it.

    Comment

    • bartonc
      Recognized Expert Expert
      • Sep 2006
      • 6478

      #3
      Originally posted by pbmods
      Heya, Tapan.

      I'm going to go ahead and move this thread to the Windows forum, where one of our resident Experts will be more likely to see it.
      Sorry, pbmods. The Windows Forum is in the Sys/Admin Group. Excel questions have been relegated to the Misc. Q.s Area. I'm moving it back there.

      Comment

      • pbmods
        Recognized Expert Expert
        • Apr 2007
        • 5821

        #4
        Originally posted by bartonc
        Sorry, pbmods. The Windows Forum is in the Sys/Admin Group. Excel questions have been relegated to the Misc. Q.s Area. I'm moving it back there.
        Very well then. We'll keep Office-related q's in Misc.

        Tapan, take a look at the date and time functions in Excel.

        Comment

        • Tapan Bera
          New Member
          • Jul 2007
          • 8

          #5
          Hi,

          I have gone through all Date Functions available in Excel.
          But I did not get my answer.
          The Year Function shows no. of Years in between two dates.
          The Month Function shows no. of Months in between two dates.
          The Day Function shows no. of Days in between two dates.
          But I unable to get the Difference between two Dates expressed in Yr.-Month- Date.
          Example:

          Date 1=10th Feb 2000
          Date 2=9th July 2007

          Difference = 7 yrs. 4 Months 29 Days

          I did not find any formula to solve this problem.

          Comment

          • pbmods
            Recognized Expert Expert
            • Apr 2007
            • 5821

            #6
            Heya, Tapan.

            Originally posted by MSDN
            =YEAR(A2)-YEAR(A1)-IF(OR(MONTH(A2) <MONTH(A1),AND( MONTH(A2)=MONTH (A1),
            DAY(A2)<DAY(A1) )),1,0)&" years, "&MONTH(A2)-MONTH(A1)+IF(AN D(MONTH(A2)
            <=MONTH(A1),DAY (A2)<DAY(A1)),1 1,IF(AND(MONTH( A2)<MONTH(A1),D AY(A2)
            >=DAY(A1)),12,I F(AND(MONTH(A2) >MONTH(A1),DAY( A2)<DAY(A1)),-1)))&" months,
            "&A2-DATE(YEAR(A2),M ONTH(A2)-IF(DAY(A2)<DAY( A1),1,0),DAY(A1 ))&" days"
            This is mostly what you need. Play around with it until you get the result you're looking for.

            Comment

            • conorb66
              New Member
              • May 2007
              • 1

              #7
              Try =((YEAR(A2-A1) - 1900) & " Years, " & (MONTH(A2-A1)) & " months, " & (DAY(A2-A1)) & " days")

              Where A1 is the first date and A2 is the second date

              Comment

              • Tapan Bera
                New Member
                • Jul 2007
                • 8

                #8
                Hi,
                conorb66
                Your answer is showing 1 months extra.
                and the answer which is taken from MSDN quite ok but
                this formula is showing certain discripency when there will be
                a leap year.
                Otherwise everything is fine.

                Very very thanks for your co-operation.

                Comment

                • DIABLO666
                  New Member
                  • Jul 2007
                  • 4

                  #9
                  Originally posted by Tapan Bera
                  Hi,

                  I have a big problem with Date function in Excel.
                  I need to find out the difference between two date.
                  Suppose, one baby was born in 10th Feb 2000.
                  What will be his age now (Yr- Month-Day).

                  Please help.
                  Simply type date of birth and then subtract it on the current system date. format cell address to date.

                  Comment

                  Working...