Group:  Microsoft Excel ยป microsoft.public.excel.worksheet.functions
Thread: DATEDIF

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

DATEDIF
Deborah 13.07.2006 09:31:02
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

Re: DATEDIF
"Franz Verga" <fra68ve[ at ]InVento.it> 13.07.2006 09:55:12
Deborah wrote:
[Quoted Text]
> 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


Re: DATEDIF
Deborah 13.07.2006 11:26:01
It seems to work.

Many thanks.

Deborah from Italy


"Franz Verga" wrote:

[Quoted Text]
> 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
>
>
>
Re: DATEDIF
"Franz Verga" <fra68ve[ at ]InVento.it> 13.07.2006 12:01:03
Deborah wrote:
[Quoted Text]
> 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


Re: DATEDIF
Muhammad Javaid Hassan 21.09.2006 18:21:02
Hi Franz, I tried your modified formula but it does not work. For example
14.02.1980 01.04.1995 15 years, 1 month, 19 days
whereas the actual difference is 15 years, 1 month, 17 days including both
monthdays. The actual and modified formula both give incorrect results. I
think excel is not able to work out the days of February days, specially for
the years divisible by 4, 100, 400 and 1600. Can anybody help me.
Thanks,
Javaid from Pakistan.

"Franz Verga" wrote:

[Quoted Text]
> 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
>
>
>
Re: DATEDIF
Muhammad Javaid Hassan 21.09.2006 18:30:02
Hi Franz, I tried your modified formula but it does not work. For example
14.02.1980 01.04.1995 15 years, 1 month, 19 days
whereas the actual difference is 15 years, 1 month, 17 days including both
monthdays. The actual and modified formula both give incorrect results. I
think excel is not able to work out the days of February days, specially for
the years divisible by 4, 100, 400 and 1600. Can anybody help me.
Thanks, waiting for the reply.
Javaid from Pakistan.

"Franz Verga" wrote:

[Quoted Text]
> 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
>
>
>

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net