+ Reply to Thread
Results 1 to 4 of 4

DATEDIF

  1. #1
    Deborah
    Guest

    DATEDIF

    I used the following formula to calculate the difference between two dates:

    =DATEDIF(A2,B2,"y") & " years, " & DATEDIF(A2,B2,"ym") & " months,
    "&DATEDIF(A2,B2,"md") & " days"

    01/01/2006 28/02/2006 0 years, 1 months, 27 days
    01/01/2006 31/01/2006 0 years, 0 months, 30 days

    Which is ok but I would want the result for the first example to be 2 months
    and for the second example 1 month.

    Should I use another formula?

    Thanks in advance
    Deborah


  2. #2
    Franz Verga
    Guest

    Re: DATEDIF

    Deborah wrote:
    > I used the following formula to calculate the difference between two
    > dates:
    >
    > =DATEDIF(A2,B2,"y") & " years, " & DATEDIF(A2,B2,"ym") & " months,
    > "&DATEDIF(A2,B2,"md") & " days"
    >
    > 01/01/2006 28/02/2006 0 years, 1 months, 27 days
    > 01/01/2006 31/01/2006 0 years, 0 months, 30 days
    >
    > Which is ok but I would want the result for the first example to be 2
    > months and for the second example 1 month.
    >
    > Should I use another formula?
    >
    > Thanks in advance
    > Deborah


    Hi Deborah,

    try with this modified formula:

    =DATEDIF(A2,B2+1,"y") & " years, " & DATEDIF(A2,B2+1,"ym") & " months,
    "&DATEDIF(A2,B2+1,"md") & " days"



    --
    Hope I helped you.

    Thanks in advance for your feedback.

    Ciao

    Franz Verga from Italy



  3. #3
    Deborah
    Guest

    Re: DATEDIF

    It seems to work.

    Many thanks.

    Deborah from Italy


    "Franz Verga" wrote:

    > Deborah wrote:
    > > I used the following formula to calculate the difference between two
    > > dates:
    > >
    > > =DATEDIF(A2,B2,"y") & " years, " & DATEDIF(A2,B2,"ym") & " months,
    > > "&DATEDIF(A2,B2,"md") & " days"
    > >
    > > 01/01/2006 28/02/2006 0 years, 1 months, 27 days
    > > 01/01/2006 31/01/2006 0 years, 0 months, 30 days
    > >
    > > Which is ok but I would want the result for the first example to be 2
    > > months and for the second example 1 month.
    > >
    > > Should I use another formula?
    > >
    > > Thanks in advance
    > > Deborah

    >
    > Hi Deborah,
    >
    > try with this modified formula:
    >
    > =DATEDIF(A2,B2+1,"y") & " years, " & DATEDIF(A2,B2+1,"ym") & " months,
    > "&DATEDIF(A2,B2+1,"md") & " days"
    >
    >
    >
    > --
    > Hope I helped you.
    >
    > Thanks in advance for your feedback.
    >
    > Ciao
    >
    > Franz Verga from Italy
    >
    >
    >


  4. #4
    Franz Verga
    Guest

    Re: DATEDIF

    Deborah wrote:
    > It seems to work.
    >
    > Many thanks.


    You're welcome.

    > Deborah from Italy



    There's also the italian speaking newsgroup:

    microsoft.public.it.office.excel



    --
    Glad I helped you.

    Thanks in advance for your feedback.

    Ciao

    Franz Verga from Italy



+ 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