+ Reply to Thread
Results 1 to 70 of 70

Number of years, months, days between two dates.

Hybrid View

  1. #1
    Bluenose
    Guest

    Number of years, months, days between two dates.

    Hello.
    I have a function that allows me to calculate the length of time between two
    dates.

    =YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
    DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
    <=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<MONTH(A1),DAY(B1)
    >=DAY(A1)),12,IF(AND(MONTH(B1)>MONTH(A1),DAY(B1)<DAY(A1)),-1)))&" months, "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"


    I have a list of dates in adjacent columns. I want to be able to display the
    result of this function in a third column, for the two dates in each row.
    Can anyone tell me whether or not it is possible to somehow do this more
    easily than pasting the function into each cell of the 3rd column and
    changing the cell references in the funtion manually?
    This is not practical as the columns are too large!
    I only have a limited knowledge of Excel so I apologise if this is a simple
    query.
    Hope you clever people can help!
    Many thanks

  2. #2
    PC
    Guest

    Re: Number of years, months, days between two dates.

    Possibly this will work

    =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months
    "&DATEDIF(A1,B1,"Md")&" Days"

    Startdate is in A1, Enddate is in B1

    HTH

    PC


    "Bluenose" <Bluenose@discussions.microsoft.com> wrote in message
    news:3B15AB91-BC5B-4ACF-B532-458A29AF780F@microsoft.com...
    > Hello.
    > I have a function that allows me to calculate the length of time between

    two
    > dates.
    >
    > =YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
    > DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
    > <=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<MONTH(A1),DAY(B1)
    > >=DAY(A1)),12,IF(AND(MONTH(B1)>MONTH(A1),DAY(B1)<DAY(A1)),-1)))&" months,

    "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"
    >
    > I have a list of dates in adjacent columns. I want to be able to display

    the
    > result of this function in a third column, for the two dates in each row.
    > Can anyone tell me whether or not it is possible to somehow do this more
    > easily than pasting the function into each cell of the 3rd column and
    > changing the cell references in the funtion manually?
    > This is not practical as the columns are too large!
    > I only have a limited knowledge of Excel so I apologise if this is a

    simple
    > query.
    > Hope you clever people can help!
    > Many thanks




  3. #3
    JE McGimpsey
    Guest

    Re: Number of years, months, days between two dates.

    That will normally work, but note that DATEDIF assumes a month is as
    long as the starting month (first argument), so if

    A1: 31 January 2005
    A2: 1 March 2005
    A3: =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months " &
    DATEDIF(A1,B1,"Md")&" Days"

    will return

    0 Years 1 Months -2 Days

    There really isn't any consistent workaround, since "month" is not an
    exact unit.


    In article <O5GIPhMXFHA.2256@TK2MSFTNGP14.phx.gbl>,
    "PC" <pcorrado@msn.com> wrote:

    > Possibly this will work
    >
    > =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months
    > "&DATEDIF(A1,B1,"Md")&" Days"
    >
    > Startdate is in A1, Enddate is in B1


  4. #4
    PC
    Guest

    Re: Number of years, months, days between two dates.

    Thanks JE

    Didn't realize that DATEDIF would "error" that easily. (working with dates
    is a huge pain)

    PC




    "JE McGimpsey" <jemcgimpsey@mvps.org> wrote in message
    news:jemcgimpsey-09C7D7.17273519052005@msnews.microsoft.com...
    > That will normally work, but note that DATEDIF assumes a month is as
    > long as the starting month (first argument), so if
    >
    > A1: 31 January 2005
    > A2: 1 March 2005
    > A3: =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months " &
    > DATEDIF(A1,B1,"Md")&" Days"
    >
    > will return
    >
    > 0 Years 1 Months -2 Days
    >
    > There really isn't any consistent workaround, since "month" is not an
    > exact unit.
    >
    >
    > In article <O5GIPhMXFHA.2256@TK2MSFTNGP14.phx.gbl>,
    > "PC" <pcorrado@msn.com> wrote:
    >
    > > Possibly this will work
    > >
    > > =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months
    > > "&DATEDIF(A1,B1,"Md")&" Days"
    > >
    > > Startdate is in A1, Enddate is in B1




  5. #5
    Arvi Laanemets
    Guest

    Re: Number of years, months, days between two dates.

    Hi


    "JE McGimpsey" <jemcgimpsey@mvps.org> wrote in message
    news:jemcgimpsey-09C7D7.17273519052005@msnews.microsoft.com...
    > That will normally work, but note that DATEDIF assumes a month is as
    > long as the starting month (first argument), so if
    >
    > A1: 31 January 2005
    > A2: 1 March 2005
    > A3: =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months " &
    > DATEDIF(A1,B1,"Md")&" Days"
    >
    > will return
    >
    > 0 Years 1 Months -2 Days
    >
    > There really isn't any consistent workaround, since "month" is not an
    > exact unit.



    This was a bad surprise for me - I have used DATEDIF quite often, and as I
    now see, without checking it tgroughly before! How about this workaround
    (days part only):

    =DATEDIF(A1,B1,"MD")+(DAY(A1)>DAY(B1))*MAX(0,DAY(EOMONTH(A1,0))-DAY(EOMONTH(B1,-1)))

    --
    Arvi Laanemets
    ( My real mail address: arvil<at>tarkon.ee )



    >
    >
    > In article <O5GIPhMXFHA.2256@TK2MSFTNGP14.phx.gbl>,
    > "PC" <pcorrado@msn.com> wrote:
    >
    >> Possibly this will work
    >>
    >> =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months
    >> "&DATEDIF(A1,B1,"Md")&" Days"
    >>
    >> Startdate is in A1, Enddate is in B1




  6. #6
    JE McGimpsey
    Guest

    Re: Number of years, months, days between two dates.

    Perhaps, but it gives some inconsistent answers...

    A1: 12/30/2004
    B1: 4/30/2004 ===> 0

    Add 1 day:

    B1: 5/1/2004 ===> 2

    What happened to 1?

    Another:

    A1: 12/30/2004
    A2: 2/28/2005 ===> 29

    but

    A2: 3/1/2005 ===> 2

    Now we skip 0 and 1.

    Those may be acceptable results for some circumstances, but it probably
    isn't for others.

    The problem, I think, is intractable. What is *exactly* 12/30/2004 plus
    two months? Legitimate cases can be made for any day in the range
    2/27/2005 - 3/2/2005, depending on how you define "month".


    In article <OEEC36PXFHA.2740@TK2MSFTNGP14.phx.gbl>,
    "Arvi Laanemets" <garbage@hot.ee> wrote:

    > This was a bad surprise for me - I have used DATEDIF quite often, and as I
    > now see, without checking it tgroughly before! How about this workaround
    > (days part only):
    >
    > =DATEDIF(A1,B1,"MD")+(DAY(A1)>DAY(B1))*MAX(0,DAY(EOMONTH(A1,0))-DAY(EOMONTH(B1
    > ,-1)))


  7. #7
    Peter Burkes
    Guest

    Re: Number of years, months, days between two dates.

    Once the period of time between the two dates is calculated, is there any way
    to allocate a certian amount of money over that period in terms of straight
    line depreciation. For example:

    If the cost of an asset is $1000 and it is depreciated over a 10 year
    period, the asset would be depreciated $100/year
    ($1,000/10years=$100/year;salvage value being ignored).

    So basically...once the annual depreciation is determined ($100 for the
    above example), can I take the DATEDIF cell and multiply it by the annual
    depreciation for the asset...taking into account years, months, and days?

    Thanks for any help.
    Peter

    "Arvi Laanemets" wrote:

    > Hi
    >
    >
    > "JE McGimpsey" <jemcgimpsey@mvps.org> wrote in message
    > news:jemcgimpsey-09C7D7.17273519052005@msnews.microsoft.com...
    > > That will normally work, but note that DATEDIF assumes a month is as
    > > long as the starting month (first argument), so if
    > >
    > > A1: 31 January 2005
    > > A2: 1 March 2005
    > > A3: =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months " &
    > > DATEDIF(A1,B1,"Md")&" Days"
    > >
    > > will return
    > >
    > > 0 Years 1 Months -2 Days
    > >
    > > There really isn't any consistent workaround, since "month" is not an
    > > exact unit.

    >
    >
    > This was a bad surprise for me - I have used DATEDIF quite often, and as I
    > now see, without checking it tgroughly before! How about this workaround
    > (days part only):
    >
    > =DATEDIF(A1,B1,"MD")+(DAY(A1)>DAY(B1))*MAX(0,DAY(EOMONTH(A1,0))-DAY(EOMONTH(B1,-1)))
    >
    > --
    > Arvi Laanemets
    > ( My real mail address: arvil<at>tarkon.ee )
    >
    >
    >
    > >
    > >
    > > In article <O5GIPhMXFHA.2256@TK2MSFTNGP14.phx.gbl>,
    > > "PC" <pcorrado@msn.com> wrote:
    > >
    > >> Possibly this will work
    > >>
    > >> =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months
    > >> "&DATEDIF(A1,B1,"Md")&" Days"
    > >>
    > >> Startdate is in A1, Enddate is in B1

    >
    >
    >


  8. #8
    JE McGimpsey
    Guest

    Re: Number of years, months, days between two dates.

    That would be a rather backward way of doing things, since your DATEDIF
    functions were being concatenated into a text string.

    If A1 is your inservice date, and B1 is your period date, and you really
    need exact daily depreciation (though I wouldn't know why), I'd be more
    inclined to use

    =(B1-A1)*SLN(1000,0,DATE(YEAR(A1)+10,MONTH(A1),DAY(A1))-A1)

    (using SLN allows you to take salvage into account). You'd be a little
    less accurate with

    =(B1-A1)*SLN(1000, 0, 3652.5)

    depending on the timing of leap years - you may be off by a dime or so
    at any one point.


    In article <EBB0D4B5-5550-468F-90E9-1B45956CA22C@microsoft.com>,
    Peter Burkes <Peter Burkes@discussions.microsoft.com> wrote:

    > Once the period of time between the two dates is calculated, is there any way
    > to allocate a certian amount of money over that period in terms of straight
    > line depreciation. For example:
    >
    > If the cost of an asset is $1000 and it is depreciated over a 10 year
    > period, the asset would be depreciated $100/year
    > ($1,000/10years=$100/year;salvage value being ignored).
    >
    > So basically...once the annual depreciation is determined ($100 for the
    > above example), can I take the DATEDIF cell and multiply it by the annual
    > depreciation for the asset...taking into account years, months, and days?


  9. #9
    Jesline
    Guest

    Re: Number of days betw two dates.


    Hi

    If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    rollover period from last year.

    I need a formula to auto calculate the number of days for Jan 05, Feb 05 and
    Mar 05 separately in different rows. how should I go about it?




    "PC" wrote:

    > Possibly this will work
    >
    > =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months
    > "&DATEDIF(A1,B1,"Md")&" Days"
    >
    > Startdate is in A1, Enddate is in B1
    >
    > HTH
    >
    > PC
    >
    >
    > "Bluenose" <Bluenose@discussions.microsoft.com> wrote in message
    > news:3B15AB91-BC5B-4ACF-B532-458A29AF780F@microsoft.com...
    > > Hello.
    > > I have a function that allows me to calculate the length of time between

    > two
    > > dates.
    > >
    > > =YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
    > > DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
    > > <=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<MONTH(A1),DAY(B1)
    > > >=DAY(A1)),12,IF(AND(MONTH(B1)>MONTH(A1),DAY(B1)<DAY(A1)),-1)))&" months,

    > "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"
    > >
    > > I have a list of dates in adjacent columns. I want to be able to display

    > the
    > > result of this function in a third column, for the two dates in each row.
    > > Can anyone tell me whether or not it is possible to somehow do this more
    > > easily than pasting the function into each cell of the 3rd column and
    > > changing the cell references in the funtion manually?
    > > This is not practical as the columns are too large!
    > > I only have a limited knowledge of Excel so I apologise if this is a

    > simple
    > > query.
    > > Hope you clever people can help!
    > > Many thanks

    >
    >
    >


  10. #10
    Ron Rosenfeld
    Guest

    Re: Number of days betw two dates.

    On Wed, 29 Jun 2005 02:51:04 -0700, "Jesline"
    <Jesline@discussions.microsoft.com> wrote:

    >
    >Hi
    >
    >If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    >rollover period from last year.
    >
    >I need a formula to auto calculate the number of days for Jan 05, Feb 05 and
    >Mar 05 separately in different rows. how should I go about it?
    >
    >
    >
    >


    A formula for days in a month, with any date in that month in A1, is:

    =32-DAY(A1-DAY(A1)+32)


    --ron

  11. #11
    Arvi Laanemets
    Guest

    Re: Number of days betw two dates.

    Hi

    A1="StartDate"
    A2="EndDate"
    A3="Days1"
    A4="Days2"
    etc.

    Into B1 and B2 enter start and end dates respectively.
    B3=IF(DATE(YEAR($B$1),MONTH($B$1)+ROW()-3,1)<$B$2,(DAY(MIN($B$2,DATE(YEAR($B$1),MONTH($B$1)+ROW()-2,0)))-DAY(MAX($B$1,DATE(YEAR($B$1),MONTH($B$1)+ROW()-3,1)))+1),"")

    Copy the formula in B3 down for as much rows you think you will need months
    maximally. (Start and end dates are included into count of days, for
    abundant months nothing - an empty string - is returned.)


    --
    Arvi Laanemets
    ( My real mail address: arvil<at>tarkon.ee )


    "Jesline" <Jesline@discussions.microsoft.com> wrote in message
    news:C122443D-2D35-4CD4-88FA-854E3E34A56E@microsoft.com...
    >
    > Hi
    >
    > If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    > rollover period from last year.
    >
    > I need a formula to auto calculate the number of days for Jan 05, Feb 05
    > and
    > Mar 05 separately in different rows. how should I go about it?
    >
    >
    >
    >
    > "PC" wrote:
    >
    >> Possibly this will work
    >>
    >> =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months
    >> "&DATEDIF(A1,B1,"Md")&" Days"
    >>
    >> Startdate is in A1, Enddate is in B1
    >>
    >> HTH
    >>
    >> PC
    >>
    >>
    >> "Bluenose" <Bluenose@discussions.microsoft.com> wrote in message
    >> news:3B15AB91-BC5B-4ACF-B532-458A29AF780F@microsoft.com...
    >> > Hello.
    >> > I have a function that allows me to calculate the length of time
    >> > between

    >> two
    >> > dates.
    >> >
    >> > =YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
    >> > DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
    >> > <=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<MONTH(A1),DAY(B1)
    >> > >=DAY(A1)),12,IF(AND(MONTH(B1)>MONTH(A1),DAY(B1)<DAY(A1)),-1)))&"
    >> > >months,

    >> "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"
    >> >
    >> > I have a list of dates in adjacent columns. I want to be able to
    >> > display

    >> the
    >> > result of this function in a third column, for the two dates in each
    >> > row.
    >> > Can anyone tell me whether or not it is possible to somehow do this
    >> > more
    >> > easily than pasting the function into each cell of the 3rd column and
    >> > changing the cell references in the funtion manually?
    >> > This is not practical as the columns are too large!
    >> > I only have a limited knowledge of Excel so I apologise if this is a

    >> simple
    >> > query.
    >> > Hope you clever people can help!
    >> > Many thanks

    >>
    >>
    >>




  12. #12
    Registered User
    Join Date
    10-23-2003
    Location
    Ohio
    Posts
    2
    Hey all...

    I thought I might tackle the year - month - day problem, but I have a few questions first.

    From the previous posts I concluded that a full month equals both of the following:

    An end date that is the same day of the month as the start date
    ex. 15 Jan 2005 & 15 Feb 2005 should be 0-1-0

    An end date that is the end of the month
    ex. 28 Feb 2005 counts as a full month presuming that the start date is prior to Feb.

    This brings up a problematic question....

    If the start month has more days than the end month AND the end date is the last day of the month while the start date is not eom but still >= the end date.....

    Ex:
    Start: 28 Jan 2005
    END: 28 Feb 2005
    Should the result be 0-1-0 or 0-1-3? ( the 28th to the 28th is 1 month so what about the 3 days left in Jan?)

    It get even weirder as you progress the dates:
    28 Jan 2005 to 27 Feb 2005 = 0-0-30 (3 days in Jan + 27 in Feb)

    28 Jan 2005 to 28 Feb 2005 = 0-1-0 ? or 0-1-3 (3 days left in Jan + Feb, yet the 28th to the 28th should be a month) but how can you go from 0-0-30 to 0-1-3 by changing just one day?

    28 Jan 2005 to 01 Mar 2005 = 0-1-1 ? or 0-1-4 (3 days left in Jan + Feb + 1 day March yet 1-28 to 2-28=1 month +1 day for March))

    29 Jan 2005 to 01 Mar 2005 = 0-1-3 (2 days left in Jan + Feb + 1 day March)

    30 Jan 2005 to 01 Mar 2005 = 0-1-2 (1 day left in Jan + Feb + 1 day March)

    Anyway, notwithstanding clarification on this problem, here is my solution:

    =IF(MONTH(B1)<MONTH(A1),YEAR(B1)-YEAR(A1)-1,YEAR(B1)-YEAR(A1))&" Years "&
    IF(MONTH(A1)>MONTH(B1),IF(DAY(B1)=DAY(EOMONTH(B1,0)),MONTH(B1)-MONTH(A1)+12,MONTH(B1)-MONTH(A1)+11),IF(DAY(B1)=DAY(EOMONTH(B1,0)),MONTH(B1)-MONTH(A1),IF(DAY(B1)>DAY(A1),MONTH(B1)-MONTH(A1),MONTH(B1)-MONTH(A1)-1)))&" Months "&
    IF(DAY(B1)=DAY(EOMONTH(B1,0)),DAY(EOMONTH(A1,0))-DAY(A1),IF(DAY(B1)<DAY(A1),DAY(EOMONTH(A1,0))-DAY(A1)+DAY(B1),DAY(B1)-DAY(A1)))&" Days"

    GrizzlyBear
    Last edited by Grizzly Bear; 06-30-2005 at 09:26 AM.
    When you eliminate the possible, whatever is left, no matter how improbable, must be the solution.

  13. #13
    Jesline
    Guest

    Re: Number of days betw two dates.


    Hi

    If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    rollover period from last year.

    I need a formula to auto calculate the number of days for Jan 05, Feb 05 and
    Mar 05 separately in different rows. how should I go about it?




    "PC" wrote:

    > Possibly this will work
    >
    > =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months
    > "&DATEDIF(A1,B1,"Md")&" Days"
    >
    > Startdate is in A1, Enddate is in B1
    >
    > HTH
    >
    > PC
    >
    >
    > "Bluenose" <Bluenose@discussions.microsoft.com> wrote in message
    > news:3B15AB91-BC5B-4ACF-B532-458A29AF780F@microsoft.com...
    > > Hello.
    > > I have a function that allows me to calculate the length of time between

    > two
    > > dates.
    > >
    > > =YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
    > > DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
    > > <=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<MONTH(A1),DAY(B1)
    > > >=DAY(A1)),12,IF(AND(MONTH(B1)>MONTH(A1),DAY(B1)<DAY(A1)),-1)))&" months,

    > "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"
    > >
    > > I have a list of dates in adjacent columns. I want to be able to display

    > the
    > > result of this function in a third column, for the two dates in each row.
    > > Can anyone tell me whether or not it is possible to somehow do this more
    > > easily than pasting the function into each cell of the 3rd column and
    > > changing the cell references in the funtion manually?
    > > This is not practical as the columns are too large!
    > > I only have a limited knowledge of Excel so I apologise if this is a

    > simple
    > > query.
    > > Hope you clever people can help!
    > > Many thanks

    >
    >
    >


  14. #14
    Jesline
    Guest

    Re: Number of days betw two dates.


    Hi

    If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    rollover period from last year.

    I need a formula to auto calculate the number of days for Jan 05, Feb 05 and
    Mar 05 separately in different rows. how should I go about it?




    "PC" wrote:

    > Possibly this will work
    >
    > =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months
    > "&DATEDIF(A1,B1,"Md")&" Days"
    >
    > Startdate is in A1, Enddate is in B1
    >
    > HTH
    >
    > PC
    >
    >
    > "Bluenose" <Bluenose@discussions.microsoft.com> wrote in message
    > news:3B15AB91-BC5B-4ACF-B532-458A29AF780F@microsoft.com...
    > > Hello.
    > > I have a function that allows me to calculate the length of time between

    > two
    > > dates.
    > >
    > > =YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
    > > DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
    > > <=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<MONTH(A1),DAY(B1)
    > > >=DAY(A1)),12,IF(AND(MONTH(B1)>MONTH(A1),DAY(B1)<DAY(A1)),-1)))&" months,

    > "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"
    > >
    > > I have a list of dates in adjacent columns. I want to be able to display

    > the
    > > result of this function in a third column, for the two dates in each row.
    > > Can anyone tell me whether or not it is possible to somehow do this more
    > > easily than pasting the function into each cell of the 3rd column and
    > > changing the cell references in the funtion manually?
    > > This is not practical as the columns are too large!
    > > I only have a limited knowledge of Excel so I apologise if this is a

    > simple
    > > query.
    > > Hope you clever people can help!
    > > Many thanks

    >
    >
    >


  15. #15
    Ron Rosenfeld
    Guest

    Re: Number of days betw two dates.

    On Wed, 29 Jun 2005 02:51:04 -0700, "Jesline"
    <Jesline@discussions.microsoft.com> wrote:

    >
    >Hi
    >
    >If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    >rollover period from last year.
    >
    >I need a formula to auto calculate the number of days for Jan 05, Feb 05 and
    >Mar 05 separately in different rows. how should I go about it?
    >
    >
    >
    >


    A formula for days in a month, with any date in that month in A1, is:

    =32-DAY(A1-DAY(A1)+32)


    --ron

  16. #16
    Ron Rosenfeld
    Guest

    Re: Number of days betw two dates.

    On Wed, 29 Jun 2005 02:51:04 -0700, "Jesline"
    <Jesline@discussions.microsoft.com> wrote:

    >
    >Hi
    >
    >If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    >rollover period from last year.
    >
    >I need a formula to auto calculate the number of days for Jan 05, Feb 05 and
    >Mar 05 separately in different rows. how should I go about it?
    >
    >
    >
    >


    A formula for days in a month, with any date in that month in A1, is:

    =32-DAY(A1-DAY(A1)+32)


    --ron

  17. #17
    Arvi Laanemets
    Guest

    Re: Number of days betw two dates.

    Hi

    A1="StartDate"
    A2="EndDate"
    A3="Days1"
    A4="Days2"
    etc.

    Into B1 and B2 enter start and end dates respectively.
    B3=IF(DATE(YEAR($B$1),MONTH($B$1)+ROW()-3,1)<$B$2,(DAY(MIN($B$2,DATE(YEAR($B$1),MONTH($B$1)+ROW()-2,0)))-DAY(MAX($B$1,DATE(YEAR($B$1),MONTH($B$1)+ROW()-3,1)))+1),"")

    Copy the formula in B3 down for as much rows you think you will need months
    maximally. (Start and end dates are included into count of days, for
    abundant months nothing - an empty string - is returned.)


    --
    Arvi Laanemets
    ( My real mail address: arvil<at>tarkon.ee )


    "Jesline" <Jesline@discussions.microsoft.com> wrote in message
    news:C122443D-2D35-4CD4-88FA-854E3E34A56E@microsoft.com...
    >
    > Hi
    >
    > If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    > rollover period from last year.
    >
    > I need a formula to auto calculate the number of days for Jan 05, Feb 05
    > and
    > Mar 05 separately in different rows. how should I go about it?
    >
    >
    >
    >
    > "PC" wrote:
    >
    >> Possibly this will work
    >>
    >> =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months
    >> "&DATEDIF(A1,B1,"Md")&" Days"
    >>
    >> Startdate is in A1, Enddate is in B1
    >>
    >> HTH
    >>
    >> PC
    >>
    >>
    >> "Bluenose" <Bluenose@discussions.microsoft.com> wrote in message
    >> news:3B15AB91-BC5B-4ACF-B532-458A29AF780F@microsoft.com...
    >> > Hello.
    >> > I have a function that allows me to calculate the length of time
    >> > between

    >> two
    >> > dates.
    >> >
    >> > =YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
    >> > DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
    >> > <=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<MONTH(A1),DAY(B1)
    >> > >=DAY(A1)),12,IF(AND(MONTH(B1)>MONTH(A1),DAY(B1)<DAY(A1)),-1)))&"
    >> > >months,

    >> "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"
    >> >
    >> > I have a list of dates in adjacent columns. I want to be able to
    >> > display

    >> the
    >> > result of this function in a third column, for the two dates in each
    >> > row.
    >> > Can anyone tell me whether or not it is possible to somehow do this
    >> > more
    >> > easily than pasting the function into each cell of the 3rd column and
    >> > changing the cell references in the funtion manually?
    >> > This is not practical as the columns are too large!
    >> > I only have a limited knowledge of Excel so I apologise if this is a

    >> simple
    >> > query.
    >> > Hope you clever people can help!
    >> > Many thanks

    >>
    >>
    >>




  18. #18
    Arvi Laanemets
    Guest

    Re: Number of days betw two dates.

    Hi

    A1="StartDate"
    A2="EndDate"
    A3="Days1"
    A4="Days2"
    etc.

    Into B1 and B2 enter start and end dates respectively.
    B3=IF(DATE(YEAR($B$1),MONTH($B$1)+ROW()-3,1)<$B$2,(DAY(MIN($B$2,DATE(YEAR($B$1),MONTH($B$1)+ROW()-2,0)))-DAY(MAX($B$1,DATE(YEAR($B$1),MONTH($B$1)+ROW()-3,1)))+1),"")

    Copy the formula in B3 down for as much rows you think you will need months
    maximally. (Start and end dates are included into count of days, for
    abundant months nothing - an empty string - is returned.)


    --
    Arvi Laanemets
    ( My real mail address: arvil<at>tarkon.ee )


    "Jesline" <Jesline@discussions.microsoft.com> wrote in message
    news:C122443D-2D35-4CD4-88FA-854E3E34A56E@microsoft.com...
    >
    > Hi
    >
    > If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    > rollover period from last year.
    >
    > I need a formula to auto calculate the number of days for Jan 05, Feb 05
    > and
    > Mar 05 separately in different rows. how should I go about it?
    >
    >
    >
    >
    > "PC" wrote:
    >
    >> Possibly this will work
    >>
    >> =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months
    >> "&DATEDIF(A1,B1,"Md")&" Days"
    >>
    >> Startdate is in A1, Enddate is in B1
    >>
    >> HTH
    >>
    >> PC
    >>
    >>
    >> "Bluenose" <Bluenose@discussions.microsoft.com> wrote in message
    >> news:3B15AB91-BC5B-4ACF-B532-458A29AF780F@microsoft.com...
    >> > Hello.
    >> > I have a function that allows me to calculate the length of time
    >> > between

    >> two
    >> > dates.
    >> >
    >> > =YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
    >> > DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
    >> > <=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<MONTH(A1),DAY(B1)
    >> > >=DAY(A1)),12,IF(AND(MONTH(B1)>MONTH(A1),DAY(B1)<DAY(A1)),-1)))&"
    >> > >months,

    >> "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"
    >> >
    >> > I have a list of dates in adjacent columns. I want to be able to
    >> > display

    >> the
    >> > result of this function in a third column, for the two dates in each
    >> > row.
    >> > Can anyone tell me whether or not it is possible to somehow do this
    >> > more
    >> > easily than pasting the function into each cell of the 3rd column and
    >> > changing the cell references in the funtion manually?
    >> > This is not practical as the columns are too large!
    >> > I only have a limited knowledge of Excel so I apologise if this is a

    >> simple
    >> > query.
    >> > Hope you clever people can help!
    >> > Many thanks

    >>
    >>
    >>




  19. #19
    Ron Rosenfeld
    Guest

    Re: Number of days betw two dates.

    On Wed, 29 Jun 2005 02:51:04 -0700, "Jesline"
    <Jesline@discussions.microsoft.com> wrote:

    >
    >Hi
    >
    >If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    >rollover period from last year.
    >
    >I need a formula to auto calculate the number of days for Jan 05, Feb 05 and
    >Mar 05 separately in different rows. how should I go about it?
    >
    >
    >
    >


    A formula for days in a month, with any date in that month in A1, is:

    =32-DAY(A1-DAY(A1)+32)


    --ron

  20. #20
    Arvi Laanemets
    Guest

    Re: Number of days betw two dates.

    Hi

    A1="StartDate"
    A2="EndDate"
    A3="Days1"
    A4="Days2"
    etc.

    Into B1 and B2 enter start and end dates respectively.
    B3=IF(DATE(YEAR($B$1),MONTH($B$1)+ROW()-3,1)<$B$2,(DAY(MIN($B$2,DATE(YEAR($B$1),MONTH($B$1)+ROW()-2,0)))-DAY(MAX($B$1,DATE(YEAR($B$1),MONTH($B$1)+ROW()-3,1)))+1),"")

    Copy the formula in B3 down for as much rows you think you will need months
    maximally. (Start and end dates are included into count of days, for
    abundant months nothing - an empty string - is returned.)


    --
    Arvi Laanemets
    ( My real mail address: arvil<at>tarkon.ee )


    "Jesline" <Jesline@discussions.microsoft.com> wrote in message
    news:C122443D-2D35-4CD4-88FA-854E3E34A56E@microsoft.com...
    >
    > Hi
    >
    > If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    > rollover period from last year.
    >
    > I need a formula to auto calculate the number of days for Jan 05, Feb 05
    > and
    > Mar 05 separately in different rows. how should I go about it?
    >
    >
    >
    >
    > "PC" wrote:
    >
    >> Possibly this will work
    >>
    >> =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months
    >> "&DATEDIF(A1,B1,"Md")&" Days"
    >>
    >> Startdate is in A1, Enddate is in B1
    >>
    >> HTH
    >>
    >> PC
    >>
    >>
    >> "Bluenose" <Bluenose@discussions.microsoft.com> wrote in message
    >> news:3B15AB91-BC5B-4ACF-B532-458A29AF780F@microsoft.com...
    >> > Hello.
    >> > I have a function that allows me to calculate the length of time
    >> > between

    >> two
    >> > dates.
    >> >
    >> > =YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
    >> > DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
    >> > <=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<MONTH(A1),DAY(B1)
    >> > >=DAY(A1)),12,IF(AND(MONTH(B1)>MONTH(A1),DAY(B1)<DAY(A1)),-1)))&"
    >> > >months,

    >> "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"
    >> >
    >> > I have a list of dates in adjacent columns. I want to be able to
    >> > display

    >> the
    >> > result of this function in a third column, for the two dates in each
    >> > row.
    >> > Can anyone tell me whether or not it is possible to somehow do this
    >> > more
    >> > easily than pasting the function into each cell of the 3rd column and
    >> > changing the cell references in the funtion manually?
    >> > This is not practical as the columns are too large!
    >> > I only have a limited knowledge of Excel so I apologise if this is a

    >> simple
    >> > query.
    >> > Hope you clever people can help!
    >> > Many thanks

    >>
    >>
    >>




  21. #21
    Jesline
    Guest

    Re: Number of days betw two dates.


    Hi

    If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    rollover period from last year.

    I need a formula to auto calculate the number of days for Jan 05, Feb 05 and
    Mar 05 separately in different rows. how should I go about it?




    "PC" wrote:

    > Possibly this will work
    >
    > =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months
    > "&DATEDIF(A1,B1,"Md")&" Days"
    >
    > Startdate is in A1, Enddate is in B1
    >
    > HTH
    >
    > PC
    >
    >
    > "Bluenose" <Bluenose@discussions.microsoft.com> wrote in message
    > news:3B15AB91-BC5B-4ACF-B532-458A29AF780F@microsoft.com...
    > > Hello.
    > > I have a function that allows me to calculate the length of time between

    > two
    > > dates.
    > >
    > > =YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
    > > DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
    > > <=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<MONTH(A1),DAY(B1)
    > > >=DAY(A1)),12,IF(AND(MONTH(B1)>MONTH(A1),DAY(B1)<DAY(A1)),-1)))&" months,

    > "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"
    > >
    > > I have a list of dates in adjacent columns. I want to be able to display

    > the
    > > result of this function in a third column, for the two dates in each row.
    > > Can anyone tell me whether or not it is possible to somehow do this more
    > > easily than pasting the function into each cell of the 3rd column and
    > > changing the cell references in the funtion manually?
    > > This is not practical as the columns are too large!
    > > I only have a limited knowledge of Excel so I apologise if this is a

    > simple
    > > query.
    > > Hope you clever people can help!
    > > Many thanks

    >
    >
    >


  22. #22
    Jesline
    Guest

    Re: Number of days betw two dates.


    Hi

    If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    rollover period from last year.

    I need a formula to auto calculate the number of days for Jan 05, Feb 05 and
    Mar 05 separately in different rows. how should I go about it?




    "PC" wrote:

    > Possibly this will work
    >
    > =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months
    > "&DATEDIF(A1,B1,"Md")&" Days"
    >
    > Startdate is in A1, Enddate is in B1
    >
    > HTH
    >
    > PC
    >
    >
    > "Bluenose" <Bluenose@discussions.microsoft.com> wrote in message
    > news:3B15AB91-BC5B-4ACF-B532-458A29AF780F@microsoft.com...
    > > Hello.
    > > I have a function that allows me to calculate the length of time between

    > two
    > > dates.
    > >
    > > =YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
    > > DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
    > > <=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<MONTH(A1),DAY(B1)
    > > >=DAY(A1)),12,IF(AND(MONTH(B1)>MONTH(A1),DAY(B1)<DAY(A1)),-1)))&" months,

    > "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"
    > >
    > > I have a list of dates in adjacent columns. I want to be able to display

    > the
    > > result of this function in a third column, for the two dates in each row.
    > > Can anyone tell me whether or not it is possible to somehow do this more
    > > easily than pasting the function into each cell of the 3rd column and
    > > changing the cell references in the funtion manually?
    > > This is not practical as the columns are too large!
    > > I only have a limited knowledge of Excel so I apologise if this is a

    > simple
    > > query.
    > > Hope you clever people can help!
    > > Many thanks

    >
    >
    >


  23. #23
    Jesline
    Guest

    Re: Number of days betw two dates.


    Hi

    If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    rollover period from last year.

    I need a formula to auto calculate the number of days for Jan 05, Feb 05 and
    Mar 05 separately in different rows. how should I go about it?




    "PC" wrote:

    > Possibly this will work
    >
    > =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months
    > "&DATEDIF(A1,B1,"Md")&" Days"
    >
    > Startdate is in A1, Enddate is in B1
    >
    > HTH
    >
    > PC
    >
    >
    > "Bluenose" <Bluenose@discussions.microsoft.com> wrote in message
    > news:3B15AB91-BC5B-4ACF-B532-458A29AF780F@microsoft.com...
    > > Hello.
    > > I have a function that allows me to calculate the length of time between

    > two
    > > dates.
    > >
    > > =YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
    > > DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
    > > <=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<MONTH(A1),DAY(B1)
    > > >=DAY(A1)),12,IF(AND(MONTH(B1)>MONTH(A1),DAY(B1)<DAY(A1)),-1)))&" months,

    > "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"
    > >
    > > I have a list of dates in adjacent columns. I want to be able to display

    > the
    > > result of this function in a third column, for the two dates in each row.
    > > Can anyone tell me whether or not it is possible to somehow do this more
    > > easily than pasting the function into each cell of the 3rd column and
    > > changing the cell references in the funtion manually?
    > > This is not practical as the columns are too large!
    > > I only have a limited knowledge of Excel so I apologise if this is a

    > simple
    > > query.
    > > Hope you clever people can help!
    > > Many thanks

    >
    >
    >


  24. #24
    Ron Rosenfeld
    Guest

    Re: Number of days betw two dates.

    On Wed, 29 Jun 2005 02:51:04 -0700, "Jesline"
    <Jesline@discussions.microsoft.com> wrote:

    >
    >Hi
    >
    >If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    >rollover period from last year.
    >
    >I need a formula to auto calculate the number of days for Jan 05, Feb 05 and
    >Mar 05 separately in different rows. how should I go about it?
    >
    >
    >
    >


    A formula for days in a month, with any date in that month in A1, is:

    =32-DAY(A1-DAY(A1)+32)


    --ron

  25. #25
    Ron Rosenfeld
    Guest

    Re: Number of days betw two dates.

    On Wed, 29 Jun 2005 02:51:04 -0700, "Jesline"
    <Jesline@discussions.microsoft.com> wrote:

    >
    >Hi
    >
    >If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    >rollover period from last year.
    >
    >I need a formula to auto calculate the number of days for Jan 05, Feb 05 and
    >Mar 05 separately in different rows. how should I go about it?
    >
    >
    >
    >


    A formula for days in a month, with any date in that month in A1, is:

    =32-DAY(A1-DAY(A1)+32)


    --ron

  26. #26
    Arvi Laanemets
    Guest

    Re: Number of days betw two dates.

    Hi

    A1="StartDate"
    A2="EndDate"
    A3="Days1"
    A4="Days2"
    etc.

    Into B1 and B2 enter start and end dates respectively.
    B3=IF(DATE(YEAR($B$1),MONTH($B$1)+ROW()-3,1)<$B$2,(DAY(MIN($B$2,DATE(YEAR($B$1),MONTH($B$1)+ROW()-2,0)))-DAY(MAX($B$1,DATE(YEAR($B$1),MONTH($B$1)+ROW()-3,1)))+1),"")

    Copy the formula in B3 down for as much rows you think you will need months
    maximally. (Start and end dates are included into count of days, for
    abundant months nothing - an empty string - is returned.)


    --
    Arvi Laanemets
    ( My real mail address: arvil<at>tarkon.ee )


    "Jesline" <Jesline@discussions.microsoft.com> wrote in message
    news:C122443D-2D35-4CD4-88FA-854E3E34A56E@microsoft.com...
    >
    > Hi
    >
    > If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    > rollover period from last year.
    >
    > I need a formula to auto calculate the number of days for Jan 05, Feb 05
    > and
    > Mar 05 separately in different rows. how should I go about it?
    >
    >
    >
    >
    > "PC" wrote:
    >
    >> Possibly this will work
    >>
    >> =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months
    >> "&DATEDIF(A1,B1,"Md")&" Days"
    >>
    >> Startdate is in A1, Enddate is in B1
    >>
    >> HTH
    >>
    >> PC
    >>
    >>
    >> "Bluenose" <Bluenose@discussions.microsoft.com> wrote in message
    >> news:3B15AB91-BC5B-4ACF-B532-458A29AF780F@microsoft.com...
    >> > Hello.
    >> > I have a function that allows me to calculate the length of time
    >> > between

    >> two
    >> > dates.
    >> >
    >> > =YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
    >> > DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
    >> > <=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<MONTH(A1),DAY(B1)
    >> > >=DAY(A1)),12,IF(AND(MONTH(B1)>MONTH(A1),DAY(B1)<DAY(A1)),-1)))&"
    >> > >months,

    >> "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"
    >> >
    >> > I have a list of dates in adjacent columns. I want to be able to
    >> > display

    >> the
    >> > result of this function in a third column, for the two dates in each
    >> > row.
    >> > Can anyone tell me whether or not it is possible to somehow do this
    >> > more
    >> > easily than pasting the function into each cell of the 3rd column and
    >> > changing the cell references in the funtion manually?
    >> > This is not practical as the columns are too large!
    >> > I only have a limited knowledge of Excel so I apologise if this is a

    >> simple
    >> > query.
    >> > Hope you clever people can help!
    >> > Many thanks

    >>
    >>
    >>




  27. #27
    Arvi Laanemets
    Guest

    Re: Number of days betw two dates.

    Hi

    A1="StartDate"
    A2="EndDate"
    A3="Days1"
    A4="Days2"
    etc.

    Into B1 and B2 enter start and end dates respectively.
    B3=IF(DATE(YEAR($B$1),MONTH($B$1)+ROW()-3,1)<$B$2,(DAY(MIN($B$2,DATE(YEAR($B$1),MONTH($B$1)+ROW()-2,0)))-DAY(MAX($B$1,DATE(YEAR($B$1),MONTH($B$1)+ROW()-3,1)))+1),"")

    Copy the formula in B3 down for as much rows you think you will need months
    maximally. (Start and end dates are included into count of days, for
    abundant months nothing - an empty string - is returned.)


    --
    Arvi Laanemets
    ( My real mail address: arvil<at>tarkon.ee )


    "Jesline" <Jesline@discussions.microsoft.com> wrote in message
    news:C122443D-2D35-4CD4-88FA-854E3E34A56E@microsoft.com...
    >
    > Hi
    >
    > If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    > rollover period from last year.
    >
    > I need a formula to auto calculate the number of days for Jan 05, Feb 05
    > and
    > Mar 05 separately in different rows. how should I go about it?
    >
    >
    >
    >
    > "PC" wrote:
    >
    >> Possibly this will work
    >>
    >> =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months
    >> "&DATEDIF(A1,B1,"Md")&" Days"
    >>
    >> Startdate is in A1, Enddate is in B1
    >>
    >> HTH
    >>
    >> PC
    >>
    >>
    >> "Bluenose" <Bluenose@discussions.microsoft.com> wrote in message
    >> news:3B15AB91-BC5B-4ACF-B532-458A29AF780F@microsoft.com...
    >> > Hello.
    >> > I have a function that allows me to calculate the length of time
    >> > between

    >> two
    >> > dates.
    >> >
    >> > =YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
    >> > DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
    >> > <=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<MONTH(A1),DAY(B1)
    >> > >=DAY(A1)),12,IF(AND(MONTH(B1)>MONTH(A1),DAY(B1)<DAY(A1)),-1)))&"
    >> > >months,

    >> "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"
    >> >
    >> > I have a list of dates in adjacent columns. I want to be able to
    >> > display

    >> the
    >> > result of this function in a third column, for the two dates in each
    >> > row.
    >> > Can anyone tell me whether or not it is possible to somehow do this
    >> > more
    >> > easily than pasting the function into each cell of the 3rd column and
    >> > changing the cell references in the funtion manually?
    >> > This is not practical as the columns are too large!
    >> > I only have a limited knowledge of Excel so I apologise if this is a

    >> simple
    >> > query.
    >> > Hope you clever people can help!
    >> > Many thanks

    >>
    >>
    >>




  28. #28
    Jesline
    Guest

    Re: Number of days betw two dates.


    Hi

    If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    rollover period from last year.

    I need a formula to auto calculate the number of days for Jan 05, Feb 05 and
    Mar 05 separately in different rows. how should I go about it?




    "PC" wrote:

    > Possibly this will work
    >
    > =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months
    > "&DATEDIF(A1,B1,"Md")&" Days"
    >
    > Startdate is in A1, Enddate is in B1
    >
    > HTH
    >
    > PC
    >
    >
    > "Bluenose" <Bluenose@discussions.microsoft.com> wrote in message
    > news:3B15AB91-BC5B-4ACF-B532-458A29AF780F@microsoft.com...
    > > Hello.
    > > I have a function that allows me to calculate the length of time between

    > two
    > > dates.
    > >
    > > =YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
    > > DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
    > > <=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<MONTH(A1),DAY(B1)
    > > >=DAY(A1)),12,IF(AND(MONTH(B1)>MONTH(A1),DAY(B1)<DAY(A1)),-1)))&" months,

    > "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"
    > >
    > > I have a list of dates in adjacent columns. I want to be able to display

    > the
    > > result of this function in a third column, for the two dates in each row.
    > > Can anyone tell me whether or not it is possible to somehow do this more
    > > easily than pasting the function into each cell of the 3rd column and
    > > changing the cell references in the funtion manually?
    > > This is not practical as the columns are too large!
    > > I only have a limited knowledge of Excel so I apologise if this is a

    > simple
    > > query.
    > > Hope you clever people can help!
    > > Many thanks

    >
    >
    >


  29. #29
    Jesline
    Guest

    Re: Number of days betw two dates.


    Hi

    If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    rollover period from last year.

    I need a formula to auto calculate the number of days for Jan 05, Feb 05 and
    Mar 05 separately in different rows. how should I go about it?




    "PC" wrote:

    > Possibly this will work
    >
    > =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months
    > "&DATEDIF(A1,B1,"Md")&" Days"
    >
    > Startdate is in A1, Enddate is in B1
    >
    > HTH
    >
    > PC
    >
    >
    > "Bluenose" <Bluenose@discussions.microsoft.com> wrote in message
    > news:3B15AB91-BC5B-4ACF-B532-458A29AF780F@microsoft.com...
    > > Hello.
    > > I have a function that allows me to calculate the length of time between

    > two
    > > dates.
    > >
    > > =YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
    > > DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
    > > <=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<MONTH(A1),DAY(B1)
    > > >=DAY(A1)),12,IF(AND(MONTH(B1)>MONTH(A1),DAY(B1)<DAY(A1)),-1)))&" months,

    > "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"
    > >
    > > I have a list of dates in adjacent columns. I want to be able to display

    > the
    > > result of this function in a third column, for the two dates in each row.
    > > Can anyone tell me whether or not it is possible to somehow do this more
    > > easily than pasting the function into each cell of the 3rd column and
    > > changing the cell references in the funtion manually?
    > > This is not practical as the columns are too large!
    > > I only have a limited knowledge of Excel so I apologise if this is a

    > simple
    > > query.
    > > Hope you clever people can help!
    > > Many thanks

    >
    >
    >


  30. #30
    Ron Rosenfeld
    Guest

    Re: Number of days betw two dates.

    On Wed, 29 Jun 2005 02:51:04 -0700, "Jesline"
    <Jesline@discussions.microsoft.com> wrote:

    >
    >Hi
    >
    >If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    >rollover period from last year.
    >
    >I need a formula to auto calculate the number of days for Jan 05, Feb 05 and
    >Mar 05 separately in different rows. how should I go about it?
    >
    >
    >
    >


    A formula for days in a month, with any date in that month in A1, is:

    =32-DAY(A1-DAY(A1)+32)


    --ron

  31. #31
    Ron Rosenfeld
    Guest

    Re: Number of days betw two dates.

    On Wed, 29 Jun 2005 02:51:04 -0700, "Jesline"
    <Jesline@discussions.microsoft.com> wrote:

    >
    >Hi
    >
    >If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    >rollover period from last year.
    >
    >I need a formula to auto calculate the number of days for Jan 05, Feb 05 and
    >Mar 05 separately in different rows. how should I go about it?
    >
    >
    >
    >


    A formula for days in a month, with any date in that month in A1, is:

    =32-DAY(A1-DAY(A1)+32)


    --ron

  32. #32
    Arvi Laanemets
    Guest

    Re: Number of days betw two dates.

    Hi

    A1="StartDate"
    A2="EndDate"
    A3="Days1"
    A4="Days2"
    etc.

    Into B1 and B2 enter start and end dates respectively.
    B3=IF(DATE(YEAR($B$1),MONTH($B$1)+ROW()-3,1)<$B$2,(DAY(MIN($B$2,DATE(YEAR($B$1),MONTH($B$1)+ROW()-2,0)))-DAY(MAX($B$1,DATE(YEAR($B$1),MONTH($B$1)+ROW()-3,1)))+1),"")

    Copy the formula in B3 down for as much rows you think you will need months
    maximally. (Start and end dates are included into count of days, for
    abundant months nothing - an empty string - is returned.)


    --
    Arvi Laanemets
    ( My real mail address: arvil<at>tarkon.ee )


    "Jesline" <Jesline@discussions.microsoft.com> wrote in message
    news:C122443D-2D35-4CD4-88FA-854E3E34A56E@microsoft.com...
    >
    > Hi
    >
    > If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    > rollover period from last year.
    >
    > I need a formula to auto calculate the number of days for Jan 05, Feb 05
    > and
    > Mar 05 separately in different rows. how should I go about it?
    >
    >
    >
    >
    > "PC" wrote:
    >
    >> Possibly this will work
    >>
    >> =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months
    >> "&DATEDIF(A1,B1,"Md")&" Days"
    >>
    >> Startdate is in A1, Enddate is in B1
    >>
    >> HTH
    >>
    >> PC
    >>
    >>
    >> "Bluenose" <Bluenose@discussions.microsoft.com> wrote in message
    >> news:3B15AB91-BC5B-4ACF-B532-458A29AF780F@microsoft.com...
    >> > Hello.
    >> > I have a function that allows me to calculate the length of time
    >> > between

    >> two
    >> > dates.
    >> >
    >> > =YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
    >> > DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
    >> > <=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<MONTH(A1),DAY(B1)
    >> > >=DAY(A1)),12,IF(AND(MONTH(B1)>MONTH(A1),DAY(B1)<DAY(A1)),-1)))&"
    >> > >months,

    >> "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"
    >> >
    >> > I have a list of dates in adjacent columns. I want to be able to
    >> > display

    >> the
    >> > result of this function in a third column, for the two dates in each
    >> > row.
    >> > Can anyone tell me whether or not it is possible to somehow do this
    >> > more
    >> > easily than pasting the function into each cell of the 3rd column and
    >> > changing the cell references in the funtion manually?
    >> > This is not practical as the columns are too large!
    >> > I only have a limited knowledge of Excel so I apologise if this is a

    >> simple
    >> > query.
    >> > Hope you clever people can help!
    >> > Many thanks

    >>
    >>
    >>




  33. #33
    Arvi Laanemets
    Guest

    Re: Number of days betw two dates.

    Hi

    A1="StartDate"
    A2="EndDate"
    A3="Days1"
    A4="Days2"
    etc.

    Into B1 and B2 enter start and end dates respectively.
    B3=IF(DATE(YEAR($B$1),MONTH($B$1)+ROW()-3,1)<$B$2,(DAY(MIN($B$2,DATE(YEAR($B$1),MONTH($B$1)+ROW()-2,0)))-DAY(MAX($B$1,DATE(YEAR($B$1),MONTH($B$1)+ROW()-3,1)))+1),"")

    Copy the formula in B3 down for as much rows you think you will need months
    maximally. (Start and end dates are included into count of days, for
    abundant months nothing - an empty string - is returned.)


    --
    Arvi Laanemets
    ( My real mail address: arvil<at>tarkon.ee )


    "Jesline" <Jesline@discussions.microsoft.com> wrote in message
    news:C122443D-2D35-4CD4-88FA-854E3E34A56E@microsoft.com...
    >
    > Hi
    >
    > If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    > rollover period from last year.
    >
    > I need a formula to auto calculate the number of days for Jan 05, Feb 05
    > and
    > Mar 05 separately in different rows. how should I go about it?
    >
    >
    >
    >
    > "PC" wrote:
    >
    >> Possibly this will work
    >>
    >> =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months
    >> "&DATEDIF(A1,B1,"Md")&" Days"
    >>
    >> Startdate is in A1, Enddate is in B1
    >>
    >> HTH
    >>
    >> PC
    >>
    >>
    >> "Bluenose" <Bluenose@discussions.microsoft.com> wrote in message
    >> news:3B15AB91-BC5B-4ACF-B532-458A29AF780F@microsoft.com...
    >> > Hello.
    >> > I have a function that allows me to calculate the length of time
    >> > between

    >> two
    >> > dates.
    >> >
    >> > =YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
    >> > DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
    >> > <=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<MONTH(A1),DAY(B1)
    >> > >=DAY(A1)),12,IF(AND(MONTH(B1)>MONTH(A1),DAY(B1)<DAY(A1)),-1)))&"
    >> > >months,

    >> "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"
    >> >
    >> > I have a list of dates in adjacent columns. I want to be able to
    >> > display

    >> the
    >> > result of this function in a third column, for the two dates in each
    >> > row.
    >> > Can anyone tell me whether or not it is possible to somehow do this
    >> > more
    >> > easily than pasting the function into each cell of the 3rd column and
    >> > changing the cell references in the funtion manually?
    >> > This is not practical as the columns are too large!
    >> > I only have a limited knowledge of Excel so I apologise if this is a

    >> simple
    >> > query.
    >> > Hope you clever people can help!
    >> > Many thanks

    >>
    >>
    >>




  34. #34
    Ron Rosenfeld
    Guest

    Re: Number of days betw two dates.

    On Wed, 29 Jun 2005 02:51:04 -0700, "Jesline"
    <Jesline@discussions.microsoft.com> wrote:

    >
    >Hi
    >
    >If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    >rollover period from last year.
    >
    >I need a formula to auto calculate the number of days for Jan 05, Feb 05 and
    >Mar 05 separately in different rows. how should I go about it?
    >
    >
    >
    >


    A formula for days in a month, with any date in that month in A1, is:

    =32-DAY(A1-DAY(A1)+32)


    --ron

  35. #35
    Arvi Laanemets
    Guest

    Re: Number of days betw two dates.

    Hi

    A1="StartDate"
    A2="EndDate"
    A3="Days1"
    A4="Days2"
    etc.

    Into B1 and B2 enter start and end dates respectively.
    B3=IF(DATE(YEAR($B$1),MONTH($B$1)+ROW()-3,1)<$B$2,(DAY(MIN($B$2,DATE(YEAR($B$1),MONTH($B$1)+ROW()-2,0)))-DAY(MAX($B$1,DATE(YEAR($B$1),MONTH($B$1)+ROW()-3,1)))+1),"")

    Copy the formula in B3 down for as much rows you think you will need months
    maximally. (Start and end dates are included into count of days, for
    abundant months nothing - an empty string - is returned.)


    --
    Arvi Laanemets
    ( My real mail address: arvil<at>tarkon.ee )


    "Jesline" <Jesline@discussions.microsoft.com> wrote in message
    news:C122443D-2D35-4CD4-88FA-854E3E34A56E@microsoft.com...
    >
    > Hi
    >
    > If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    > rollover period from last year.
    >
    > I need a formula to auto calculate the number of days for Jan 05, Feb 05
    > and
    > Mar 05 separately in different rows. how should I go about it?
    >
    >
    >
    >
    > "PC" wrote:
    >
    >> Possibly this will work
    >>
    >> =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months
    >> "&DATEDIF(A1,B1,"Md")&" Days"
    >>
    >> Startdate is in A1, Enddate is in B1
    >>
    >> HTH
    >>
    >> PC
    >>
    >>
    >> "Bluenose" <Bluenose@discussions.microsoft.com> wrote in message
    >> news:3B15AB91-BC5B-4ACF-B532-458A29AF780F@microsoft.com...
    >> > Hello.
    >> > I have a function that allows me to calculate the length of time
    >> > between

    >> two
    >> > dates.
    >> >
    >> > =YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
    >> > DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
    >> > <=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<MONTH(A1),DAY(B1)
    >> > >=DAY(A1)),12,IF(AND(MONTH(B1)>MONTH(A1),DAY(B1)<DAY(A1)),-1)))&"
    >> > >months,

    >> "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"
    >> >
    >> > I have a list of dates in adjacent columns. I want to be able to
    >> > display

    >> the
    >> > result of this function in a third column, for the two dates in each
    >> > row.
    >> > Can anyone tell me whether or not it is possible to somehow do this
    >> > more
    >> > easily than pasting the function into each cell of the 3rd column and
    >> > changing the cell references in the funtion manually?
    >> > This is not practical as the columns are too large!
    >> > I only have a limited knowledge of Excel so I apologise if this is a

    >> simple
    >> > query.
    >> > Hope you clever people can help!
    >> > Many thanks

    >>
    >>
    >>




  36. #36
    Jesline
    Guest

    Re: Number of days betw two dates.


    Hi

    If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    rollover period from last year.

    I need a formula to auto calculate the number of days for Jan 05, Feb 05 and
    Mar 05 separately in different rows. how should I go about it?




    "PC" wrote:

    > Possibly this will work
    >
    > =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months
    > "&DATEDIF(A1,B1,"Md")&" Days"
    >
    > Startdate is in A1, Enddate is in B1
    >
    > HTH
    >
    > PC
    >
    >
    > "Bluenose" <Bluenose@discussions.microsoft.com> wrote in message
    > news:3B15AB91-BC5B-4ACF-B532-458A29AF780F@microsoft.com...
    > > Hello.
    > > I have a function that allows me to calculate the length of time between

    > two
    > > dates.
    > >
    > > =YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
    > > DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
    > > <=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<MONTH(A1),DAY(B1)
    > > >=DAY(A1)),12,IF(AND(MONTH(B1)>MONTH(A1),DAY(B1)<DAY(A1)),-1)))&" months,

    > "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"
    > >
    > > I have a list of dates in adjacent columns. I want to be able to display

    > the
    > > result of this function in a third column, for the two dates in each row.
    > > Can anyone tell me whether or not it is possible to somehow do this more
    > > easily than pasting the function into each cell of the 3rd column and
    > > changing the cell references in the funtion manually?
    > > This is not practical as the columns are too large!
    > > I only have a limited knowledge of Excel so I apologise if this is a

    > simple
    > > query.
    > > Hope you clever people can help!
    > > Many thanks

    >
    >
    >


  37. #37
    Jesline
    Guest

    Re: Number of days betw two dates.


    Hi

    If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    rollover period from last year.

    I need a formula to auto calculate the number of days for Jan 05, Feb 05 and
    Mar 05 separately in different rows. how should I go about it?




    "PC" wrote:

    > Possibly this will work
    >
    > =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months
    > "&DATEDIF(A1,B1,"Md")&" Days"
    >
    > Startdate is in A1, Enddate is in B1
    >
    > HTH
    >
    > PC
    >
    >
    > "Bluenose" <Bluenose@discussions.microsoft.com> wrote in message
    > news:3B15AB91-BC5B-4ACF-B532-458A29AF780F@microsoft.com...
    > > Hello.
    > > I have a function that allows me to calculate the length of time between

    > two
    > > dates.
    > >
    > > =YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
    > > DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
    > > <=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<MONTH(A1),DAY(B1)
    > > >=DAY(A1)),12,IF(AND(MONTH(B1)>MONTH(A1),DAY(B1)<DAY(A1)),-1)))&" months,

    > "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"
    > >
    > > I have a list of dates in adjacent columns. I want to be able to display

    > the
    > > result of this function in a third column, for the two dates in each row.
    > > Can anyone tell me whether or not it is possible to somehow do this more
    > > easily than pasting the function into each cell of the 3rd column and
    > > changing the cell references in the funtion manually?
    > > This is not practical as the columns are too large!
    > > I only have a limited knowledge of Excel so I apologise if this is a

    > simple
    > > query.
    > > Hope you clever people can help!
    > > Many thanks

    >
    >
    >


  38. #38
    Jesline
    Guest

    Re: Number of days betw two dates.


    Hi

    If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    rollover period from last year.

    I need a formula to auto calculate the number of days for Jan 05, Feb 05 and
    Mar 05 separately in different rows. how should I go about it?




    "PC" wrote:

    > Possibly this will work
    >
    > =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months
    > "&DATEDIF(A1,B1,"Md")&" Days"
    >
    > Startdate is in A1, Enddate is in B1
    >
    > HTH
    >
    > PC
    >
    >
    > "Bluenose" <Bluenose@discussions.microsoft.com> wrote in message
    > news:3B15AB91-BC5B-4ACF-B532-458A29AF780F@microsoft.com...
    > > Hello.
    > > I have a function that allows me to calculate the length of time between

    > two
    > > dates.
    > >
    > > =YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
    > > DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
    > > <=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<MONTH(A1),DAY(B1)
    > > >=DAY(A1)),12,IF(AND(MONTH(B1)>MONTH(A1),DAY(B1)<DAY(A1)),-1)))&" months,

    > "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"
    > >
    > > I have a list of dates in adjacent columns. I want to be able to display

    > the
    > > result of this function in a third column, for the two dates in each row.
    > > Can anyone tell me whether or not it is possible to somehow do this more
    > > easily than pasting the function into each cell of the 3rd column and
    > > changing the cell references in the funtion manually?
    > > This is not practical as the columns are too large!
    > > I only have a limited knowledge of Excel so I apologise if this is a

    > simple
    > > query.
    > > Hope you clever people can help!
    > > Many thanks

    >
    >
    >


  39. #39
    Jesline
    Guest

    Re: Number of days betw two dates.


    Hi

    If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    rollover period from last year.

    I need a formula to auto calculate the number of days for Jan 05, Feb 05 and
    Mar 05 separately in different rows. how should I go about it?




    "PC" wrote:

    > Possibly this will work
    >
    > =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months
    > "&DATEDIF(A1,B1,"Md")&" Days"
    >
    > Startdate is in A1, Enddate is in B1
    >
    > HTH
    >
    > PC
    >
    >
    > "Bluenose" <Bluenose@discussions.microsoft.com> wrote in message
    > news:3B15AB91-BC5B-4ACF-B532-458A29AF780F@microsoft.com...
    > > Hello.
    > > I have a function that allows me to calculate the length of time between

    > two
    > > dates.
    > >
    > > =YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
    > > DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
    > > <=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<MONTH(A1),DAY(B1)
    > > >=DAY(A1)),12,IF(AND(MONTH(B1)>MONTH(A1),DAY(B1)<DAY(A1)),-1)))&" months,

    > "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"
    > >
    > > I have a list of dates in adjacent columns. I want to be able to display

    > the
    > > result of this function in a third column, for the two dates in each row.
    > > Can anyone tell me whether or not it is possible to somehow do this more
    > > easily than pasting the function into each cell of the 3rd column and
    > > changing the cell references in the funtion manually?
    > > This is not practical as the columns are too large!
    > > I only have a limited knowledge of Excel so I apologise if this is a

    > simple
    > > query.
    > > Hope you clever people can help!
    > > Many thanks

    >
    >
    >


  40. #40
    Ron Rosenfeld
    Guest

    Re: Number of days betw two dates.

    On Wed, 29 Jun 2005 02:51:04 -0700, "Jesline"
    <Jesline@discussions.microsoft.com> wrote:

    >
    >Hi
    >
    >If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    >rollover period from last year.
    >
    >I need a formula to auto calculate the number of days for Jan 05, Feb 05 and
    >Mar 05 separately in different rows. how should I go about it?
    >
    >
    >
    >


    A formula for days in a month, with any date in that month in A1, is:

    =32-DAY(A1-DAY(A1)+32)


    --ron

  41. #41
    Ron Rosenfeld
    Guest

    Re: Number of days betw two dates.

    On Wed, 29 Jun 2005 02:51:04 -0700, "Jesline"
    <Jesline@discussions.microsoft.com> wrote:

    >
    >Hi
    >
    >If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    >rollover period from last year.
    >
    >I need a formula to auto calculate the number of days for Jan 05, Feb 05 and
    >Mar 05 separately in different rows. how should I go about it?
    >
    >
    >
    >


    A formula for days in a month, with any date in that month in A1, is:

    =32-DAY(A1-DAY(A1)+32)


    --ron

  42. #42
    Ron Rosenfeld
    Guest

    Re: Number of days betw two dates.

    On Wed, 29 Jun 2005 02:51:04 -0700, "Jesline"
    <Jesline@discussions.microsoft.com> wrote:

    >
    >Hi
    >
    >If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    >rollover period from last year.
    >
    >I need a formula to auto calculate the number of days for Jan 05, Feb 05 and
    >Mar 05 separately in different rows. how should I go about it?
    >
    >
    >
    >


    A formula for days in a month, with any date in that month in A1, is:

    =32-DAY(A1-DAY(A1)+32)


    --ron

  43. #43
    Arvi Laanemets
    Guest

    Re: Number of days betw two dates.

    Hi

    A1="StartDate"
    A2="EndDate"
    A3="Days1"
    A4="Days2"
    etc.

    Into B1 and B2 enter start and end dates respectively.
    B3=IF(DATE(YEAR($B$1),MONTH($B$1)+ROW()-3,1)<$B$2,(DAY(MIN($B$2,DATE(YEAR($B$1),MONTH($B$1)+ROW()-2,0)))-DAY(MAX($B$1,DATE(YEAR($B$1),MONTH($B$1)+ROW()-3,1)))+1),"")

    Copy the formula in B3 down for as much rows you think you will need months
    maximally. (Start and end dates are included into count of days, for
    abundant months nothing - an empty string - is returned.)


    --
    Arvi Laanemets
    ( My real mail address: arvil<at>tarkon.ee )


    "Jesline" <Jesline@discussions.microsoft.com> wrote in message
    news:C122443D-2D35-4CD4-88FA-854E3E34A56E@microsoft.com...
    >
    > Hi
    >
    > If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    > rollover period from last year.
    >
    > I need a formula to auto calculate the number of days for Jan 05, Feb 05
    > and
    > Mar 05 separately in different rows. how should I go about it?
    >
    >
    >
    >
    > "PC" wrote:
    >
    >> Possibly this will work
    >>
    >> =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months
    >> "&DATEDIF(A1,B1,"Md")&" Days"
    >>
    >> Startdate is in A1, Enddate is in B1
    >>
    >> HTH
    >>
    >> PC
    >>
    >>
    >> "Bluenose" <Bluenose@discussions.microsoft.com> wrote in message
    >> news:3B15AB91-BC5B-4ACF-B532-458A29AF780F@microsoft.com...
    >> > Hello.
    >> > I have a function that allows me to calculate the length of time
    >> > between

    >> two
    >> > dates.
    >> >
    >> > =YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
    >> > DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
    >> > <=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<MONTH(A1),DAY(B1)
    >> > >=DAY(A1)),12,IF(AND(MONTH(B1)>MONTH(A1),DAY(B1)<DAY(A1)),-1)))&"
    >> > >months,

    >> "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"
    >> >
    >> > I have a list of dates in adjacent columns. I want to be able to
    >> > display

    >> the
    >> > result of this function in a third column, for the two dates in each
    >> > row.
    >> > Can anyone tell me whether or not it is possible to somehow do this
    >> > more
    >> > easily than pasting the function into each cell of the 3rd column and
    >> > changing the cell references in the funtion manually?
    >> > This is not practical as the columns are too large!
    >> > I only have a limited knowledge of Excel so I apologise if this is a

    >> simple
    >> > query.
    >> > Hope you clever people can help!
    >> > Many thanks

    >>
    >>
    >>




  44. #44
    Arvi Laanemets
    Guest

    Re: Number of days betw two dates.

    Hi

    A1="StartDate"
    A2="EndDate"
    A3="Days1"
    A4="Days2"
    etc.

    Into B1 and B2 enter start and end dates respectively.
    B3=IF(DATE(YEAR($B$1),MONTH($B$1)+ROW()-3,1)<$B$2,(DAY(MIN($B$2,DATE(YEAR($B$1),MONTH($B$1)+ROW()-2,0)))-DAY(MAX($B$1,DATE(YEAR($B$1),MONTH($B$1)+ROW()-3,1)))+1),"")

    Copy the formula in B3 down for as much rows you think you will need months
    maximally. (Start and end dates are included into count of days, for
    abundant months nothing - an empty string - is returned.)


    --
    Arvi Laanemets
    ( My real mail address: arvil<at>tarkon.ee )


    "Jesline" <Jesline@discussions.microsoft.com> wrote in message
    news:C122443D-2D35-4CD4-88FA-854E3E34A56E@microsoft.com...
    >
    > Hi
    >
    > If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    > rollover period from last year.
    >
    > I need a formula to auto calculate the number of days for Jan 05, Feb 05
    > and
    > Mar 05 separately in different rows. how should I go about it?
    >
    >
    >
    >
    > "PC" wrote:
    >
    >> Possibly this will work
    >>
    >> =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months
    >> "&DATEDIF(A1,B1,"Md")&" Days"
    >>
    >> Startdate is in A1, Enddate is in B1
    >>
    >> HTH
    >>
    >> PC
    >>
    >>
    >> "Bluenose" <Bluenose@discussions.microsoft.com> wrote in message
    >> news:3B15AB91-BC5B-4ACF-B532-458A29AF780F@microsoft.com...
    >> > Hello.
    >> > I have a function that allows me to calculate the length of time
    >> > between

    >> two
    >> > dates.
    >> >
    >> > =YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
    >> > DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
    >> > <=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<MONTH(A1),DAY(B1)
    >> > >=DAY(A1)),12,IF(AND(MONTH(B1)>MONTH(A1),DAY(B1)<DAY(A1)),-1)))&"
    >> > >months,

    >> "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"
    >> >
    >> > I have a list of dates in adjacent columns. I want to be able to
    >> > display

    >> the
    >> > result of this function in a third column, for the two dates in each
    >> > row.
    >> > Can anyone tell me whether or not it is possible to somehow do this
    >> > more
    >> > easily than pasting the function into each cell of the 3rd column and
    >> > changing the cell references in the funtion manually?
    >> > This is not practical as the columns are too large!
    >> > I only have a limited knowledge of Excel so I apologise if this is a

    >> simple
    >> > query.
    >> > Hope you clever people can help!
    >> > Many thanks

    >>
    >>
    >>




  45. #45
    Arvi Laanemets
    Guest

    Re: Number of days betw two dates.

    Hi

    A1="StartDate"
    A2="EndDate"
    A3="Days1"
    A4="Days2"
    etc.

    Into B1 and B2 enter start and end dates respectively.
    B3=IF(DATE(YEAR($B$1),MONTH($B$1)+ROW()-3,1)<$B$2,(DAY(MIN($B$2,DATE(YEAR($B$1),MONTH($B$1)+ROW()-2,0)))-DAY(MAX($B$1,DATE(YEAR($B$1),MONTH($B$1)+ROW()-3,1)))+1),"")

    Copy the formula in B3 down for as much rows you think you will need months
    maximally. (Start and end dates are included into count of days, for
    abundant months nothing - an empty string - is returned.)


    --
    Arvi Laanemets
    ( My real mail address: arvil<at>tarkon.ee )


    "Jesline" <Jesline@discussions.microsoft.com> wrote in message
    news:C122443D-2D35-4CD4-88FA-854E3E34A56E@microsoft.com...
    >
    > Hi
    >
    > If let say I have start date: 15/12/04 and end date : 28/3/05 for a loan
    > rollover period from last year.
    >
    > I need a formula to auto calculate the number of days for Jan 05, Feb 05
    > and
    > Mar 05 separately in different rows. how should I go about it?
    >
    >
    >
    >
    > "PC" wrote:
    >
    >> Possibly this will work
    >>
    >> =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months
    >> "&DATEDIF(A1,B1,"Md")&" Days"
    >>
    >> Startdate is in A1, Enddate is in B1
    >>
    >> HTH
    >>
    >> PC
    >>
    >>
    >> "Bluenose" <Bluenose@discussions.microsoft.com> wrote in message
    >> news:3B15AB91-BC5B-4ACF-B532-458A29AF780F@microsoft.com...
    >> > Hello.
    >> > I have a function that allows me to calculate the length of time
    >> > between

    >> two
    >> > dates.
    >> >
    >> > =YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
    >> > DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
    >> > <=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<MONTH(A1),DAY(B1)
    >> > >=DAY(A1)),12,IF(AND(MONTH(B1)>MONTH(A1),DAY(B1)<DAY(A1)),-1)))&"
    >> > >months,

    >> "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"
    >> >
    >> > I have a list of dates in adjacent columns. I want to be able to
    >> > display

    >> the
    >> > result of this function in a third column, for the two dates in each
    >> > row.
    >> > Can anyone tell me whether or not it is possible to somehow do this
    >> > more
    >> > easily than pasting the function into each cell of the 3rd column and
    >> > changing the cell references in the funtion manually?
    >> > This is not practical as the columns are too large!
    >> > I only have a limited knowledge of Excel so I apologise if this is a

    >> simple
    >> > query.
    >> > Hope you clever people can help!
    >> > Many thanks

    >>
    >>
    >>




  46. #46
    Ron Rosenfeld
    Guest

    Re: Number of years, months, days between two dates.

    On Thu, 19 May 2005 15:57:03 -0700, "Bluenose"
    <Bluenose@discussions.microsoft.com> wrote:

    >Hello.
    >I have a function that allows me to calculate the length of time between two
    >dates.
    >
    >=YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
    >DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
    ><=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<MONTH(A1),DAY(B1)
    >>=DAY(A1)),12,IF(AND(MONTH(B1)>MONTH(A1),DAY(B1)<DAY(A1)),-1)))&" months, "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"

    >
    >I have a list of dates in adjacent columns. I want to be able to display the
    >result of this function in a third column, for the two dates in each row.
    >Can anyone tell me whether or not it is possible to somehow do this more
    >easily than pasting the function into each cell of the 3rd column and
    >changing the cell references in the funtion manually?
    >This is not practical as the columns are too large!
    >I only have a limited knowledge of Excel so I apologise if this is a simple
    >query.
    >Hope you clever people can help!
    >Many thanks


    Any result expressed in years, months and days will be inexact since a "month"
    can be anywhere from 28-31 days.

    So is some rough approximation OK, or do you want to set up rules for what to
    do if, for example, your dates are 31 Jan 2005; 1 Mar 2005.

    Both your formula and the DATEDIF() formula posted by PC give a result of

    0 years, 1 months, -2 days



    --ron

  47. #47
    Mangesh
    Guest

    Re: Number of years, months, days between two dates.

    =YEAR(A2)-YEAR(A1)-IF(MONTH(A2)>=MONTH(A1),0,1) & " " &
    (MONTH(A2)-MONTH(A1))-IF(DAY(A2)>=DAY(A1),0,1)+IF(MONTH(A2)<MONTH(A1),12,0)
    & " " &
    IF(DAY(A2)-DAY(A1)<0,DAY(DATE(YEAR(A2),MONTH(A2),1)-1)+(DAY(A2)-DAY(A1)),DAY
    (A2)-DAY(A1))

    A1 = start date
    A2 = End date

    This should work fine enough. Tested 4 cases with it:
    http://excelforum.com/showthread.php?t=371874


    - Mangesh




    "Ron Rosenfeld" <ronrosenfeld@nospam.org> wrote in message
    news:rocq819b00t3a6iestjc2avk1o6ihaui6v@4ax.com...
    > On Thu, 19 May 2005 15:57:03 -0700, "Bluenose"
    > <Bluenose@discussions.microsoft.com> wrote:
    >
    > >Hello.
    > >I have a function that allows me to calculate the length of time between

    two
    > >dates.
    > >
    > >=YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
    > >DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
    > ><=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<MONTH(A1),DAY(B1)
    > >>=DAY(A1)),12,IF(AND(MONTH(B1)>MONTH(A1),DAY(B1)<DAY(A1)),-1)))&" months,

    "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"
    > >
    > >I have a list of dates in adjacent columns. I want to be able to display

    the
    > >result of this function in a third column, for the two dates in each row.
    > >Can anyone tell me whether or not it is possible to somehow do this more
    > >easily than pasting the function into each cell of the 3rd column and
    > >changing the cell references in the funtion manually?
    > >This is not practical as the columns are too large!
    > >I only have a limited knowledge of Excel so I apologise if this is a

    simple
    > >query.
    > >Hope you clever people can help!
    > >Many thanks

    >
    > Any result expressed in years, months and days will be inexact since a

    "month"
    > can be anywhere from 28-31 days.
    >
    > So is some rough approximation OK, or do you want to set up rules for what

    to
    > do if, for example, your dates are 31 Jan 2005; 1 Mar 2005.
    >
    > Both your formula and the DATEDIF() formula posted by PC give a result of
    >
    > 0 years, 1 months, -2 days
    >
    >
    >
    > --ron




  48. #48
    Ron Rosenfeld
    Guest

    Re: Number of years, months, days between two dates.

    On Fri, 20 May 2005 11:44:13 +0530, "Mangesh" <mangesh.yadav@NOSPAMgmail.com>
    wrote:

    >=YEAR(A2)-YEAR(A1)-IF(MONTH(A2)>=MONTH(A1),0,1) & " " &
    >(MONTH(A2)-MONTH(A1))-IF(DAY(A2)>=DAY(A1),0,1)+IF(MONTH(A2)<MONTH(A1),12,0)
    >& " " &
    >IF(DAY(A2)-DAY(A1)<0,DAY(DATE(YEAR(A2),MONTH(A2),1)-1)+(DAY(A2)-DAY(A1)),DAY
    >(A2)-DAY(A1))
    >
    >A1 = start date
    >A2 = End date


    It gives silly answer with

    A1: 31 Jan 2005
    A2: 1 Mar 2005
    --ron

  49. #49
    Mangesh
    Guest

    Re: Number of years, months, days between two dates.

    =YEAR(A2)-YEAR(A1)-IF(MONTH(A2)>=MONTH(A1),0,1) & " " &
    (MONTH(A2)-MONTH(A1))-IF(DAY(A2)>=DAY(A1),0,1)+IF(MONTH(A2)<MONTH(A1),12,0)
    & " " &
    A2-(DATE(YEAR(A1)+(YEAR(A2)-YEAR(A1)-IF(MONTH(A2)>=MONTH(A1),0,1)),MONTH(A1)
    +((MONTH(A2)-MONTH(A1))-IF(DAY(A2)>=DAY(A1),0,1)+IF(MONTH(A2)<MONTH(A1),12,0
    )),DAY(A1)))+IF(A2-(DATE(YEAR(A1)+(YEAR(A2)-YEAR(A1)-IF(MONTH(A2)>=MONTH(A1)
    ,0,1)),MONTH(A1)+((MONTH(A2)-MONTH(A1))-IF(DAY(A2)>=DAY(A1),0,1)+IF(MONTH(A2
    )<MONTH(A1),12,0)),DAY(A1)))<0,DAY(DATE(YEAR(A1)+(YEAR(A2)-YEAR(A1)-IF(MONTH
    (A2)>=MONTH(A1),0,1)),MONTH(A1)+((MONTH(A2)-MONTH(A1))-IF(DAY(A2)>=DAY(A1),0
    ,1)+IF(MONTH(A2)<MONTH(A1),12,0)),DAY(A1))),0)


    - Mangesh



    "Ron Rosenfeld" <ronrosenfeld@nospam.org> wrote in message
    news:8acr81p00i8i2au0hgne8d3kn6lupc5e5u@4ax.com...
    > On Fri, 20 May 2005 11:44:13 +0530, "Mangesh"

    <mangesh.yadav@NOSPAMgmail.com>
    > wrote:
    >
    > >=YEAR(A2)-YEAR(A1)-IF(MONTH(A2)>=MONTH(A1),0,1) & " " &

    >
    >(MONTH(A2)-MONTH(A1))-IF(DAY(A2)>=DAY(A1),0,1)+IF(MONTH(A2)<MONTH(A1),12,0)
    > >& " " &

    >
    >IF(DAY(A2)-DAY(A1)<0,DAY(DATE(YEAR(A2),MONTH(A2),1)-1)+(DAY(A2)-DAY(A1)),DA

    Y
    > >(A2)-DAY(A1))
    > >
    > >A1 = start date
    > >A2 = End date

    >
    > It gives silly answer with
    >
    > A1: 31 Jan 2005
    > A2: 1 Mar 2005
    > --ron




  50. #50
    JE McGimpsey
    Guest

    Re: Number of years, months, days between two dates.

    Hmmmm...

    A1: 12/30/2004

    A2: 3/1/2005 ===> 0 2 1

    Add one day:

    A2: 3/2/2005 ===> 0 2 0

    Add another day:

    A2: 3/3/2005 ===> 0 2 1

    or

    A2: 12/1/2005 ===> 1 -1 1





    In article <O8A3mLcXFHA.4032@tk2msftngp13.phx.gbl>,
    "Mangesh" <mangesh.yadav@NOSPAMgmail.com> wrote:

    > =YEAR(A2)-YEAR(A1)-IF(MONTH(A2)>=MONTH(A1),0,1) & " " &
    > (MONTH(A2)-MONTH(A1))-IF(DAY(A2)>=DAY(A1),0,1)+IF(MONTH(A2)<MONTH(A1),12,0)
    > & " " &
    > A2-(DATE(YEAR(A1)+(YEAR(A2)-YEAR(A1)-IF(MONTH(A2)>=MONTH(A1),0,1)),MONTH(A1)
    > +((MONTH(A2)-MONTH(A1))-IF(DAY(A2)>=DAY(A1),0,1)+IF(MONTH(A2)<MONTH(A1),12,0
    > )),DAY(A1)))+IF(A2-(DATE(YEAR(A1)+(YEAR(A2)-YEAR(A1)-IF(MONTH(A2)>=MONTH(A1)
    > ,0,1)),MONTH(A1)+((MONTH(A2)-MONTH(A1))-IF(DAY(A2)>=DAY(A1),0,1)+IF(MONTH(A2
    > )<MONTH(A1),12,0)),DAY(A1)))<0,DAY(DATE(YEAR(A1)+(YEAR(A2)-YEAR(A1)-IF(MONTH
    > (A2)>=MONTH(A1),0,1)),MONTH(A1)+((MONTH(A2)-MONTH(A1))-IF(DAY(A2)>=DAY(A1),0
    > ,1)+IF(MONTH(A2)<MONTH(A1),12,0)),DAY(A1))),0)


  51. #51
    Mangesh
    Guest

    Re: Number of years, months, days between two dates.

    You simply need to drag down (copy) your result in subsequent rows below. No
    need to edit each time.

    - Mangesh



    "Bluenose" <Bluenose@discussions.microsoft.com> wrote in message
    news:3B15AB91-BC5B-4ACF-B532-458A29AF780F@microsoft.com...
    > Hello.
    > I have a function that allows me to calculate the length of time between

    two
    > dates.
    >
    > =YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
    > DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
    > <=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<MONTH(A1),DAY(B1)
    > >=DAY(A1)),12,IF(AND(MONTH(B1)>MONTH(A1),DAY(B1)<DAY(A1)),-1)))&" months,

    "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"
    >
    > I have a list of dates in adjacent columns. I want to be able to display

    the
    > result of this function in a third column, for the two dates in each row.
    > Can anyone tell me whether or not it is possible to somehow do this more
    > easily than pasting the function into each cell of the 3rd column and
    > changing the cell references in the funtion manually?
    > This is not practical as the columns are too large!
    > I only have a limited knowledge of Excel so I apologise if this is a

    simple
    > query.
    > Hope you clever people can help!
    > Many thanks




  52. #52
    Registered User
    Join Date
    08-01-2008
    Location
    Arizona
    Posts
    25

    Re: Number of years, months, days between two dates.

    I'm looking for information on this topic-- how to automatically count the number of days between two dates. Seems very cumbersome. =( Anyone know of a website that gives you the option to plug in two dates and calculate the days between?

  53. #53
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Number of years, months, days between two dates.

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

+ 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