+ Reply to Thread
Results 1 to 20 of 20

Calculating days between dates and leap years

Hybrid View

  1. #1
    KimberlyC
    Guest

    Calculating days between dates and leap years

    Hi
    I have a "from" date in col A and a "to" date in Col B
    In Col C, I'm using the following formula to find the days between the two
    dates in A and B.

    =B8-A8

    Is there something I can add to this formula to add one day to the answer in
    col C ....if it's a leap year.

    For example, if I have 1/1/05 in A8 and 12/31/05 in B8, the answer is
    364...and I need it to be the full year of 365 days.

    Not sure how to adjust the formula for leap year or if that is possible..
    Thanks in advance for you help..
    Kimberly



  2. #2
    Bob Phillips
    Guest

    Re: Calculating days between dates and leap years

    Since when has 2005 been a leap year? In a (true) leap year, you will get
    365.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "KimberlyC" <kimberchia@sbcglobal.net> wrote in message
    news:eHzHIBpJFHA.3076@tk2msftngp13.phx.gbl...
    > Hi
    > I have a "from" date in col A and a "to" date in Col B
    > In Col C, I'm using the following formula to find the days between the two
    > dates in A and B.
    >
    > =B8-A8
    >
    > Is there something I can add to this formula to add one day to the answer

    in
    > col C ....if it's a leap year.
    >
    > For example, if I have 1/1/05 in A8 and 12/31/05 in B8, the answer is
    > 364...and I need it to be the full year of 365 days.
    >
    > Not sure how to adjust the formula for leap year or if that is possible..
    > Thanks in advance for you help..
    > Kimberly
    >
    >




  3. #3
    KimberlyC
    Guest

    Re: Calculating days between dates and leap years

    I realized after I posted it.. I had it backwards.....but thanks for your
    help.
    I'll just add one to my formula..



    "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
    news:OQYiTIpJFHA.588@TK2MSFTNGP15.phx.gbl...
    > Since when has 2005 been a leap year? In a (true) leap year, you will get
    > 365.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "KimberlyC" <kimberchia@sbcglobal.net> wrote in message
    > news:eHzHIBpJFHA.3076@tk2msftngp13.phx.gbl...
    > > Hi
    > > I have a "from" date in col A and a "to" date in Col B
    > > In Col C, I'm using the following formula to find the days between the

    two
    > > dates in A and B.
    > >
    > > =B8-A8
    > >
    > > Is there something I can add to this formula to add one day to the

    answer
    > in
    > > col C ....if it's a leap year.
    > >
    > > For example, if I have 1/1/05 in A8 and 12/31/05 in B8, the answer is
    > > 364...and I need it to be the full year of 365 days.
    > >
    > > Not sure how to adjust the formula for leap year or if that is

    possible..
    > > Thanks in advance for you help..
    > > Kimberly
    > >
    > >

    >
    >




  4. #4
    Bob Phillips
    Guest

    Re: Calculating days between dates and leap years

    But why, it works fine without?

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "KimberlyC" <kimberchia@sbcglobal.net> wrote in message
    news:ep0MFUpJFHA.4012@TK2MSFTNGP09.phx.gbl...
    > I realized after I posted it.. I had it backwards.....but thanks for your
    > help.
    > I'll just add one to my formula..
    >
    >
    >
    > "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
    > news:OQYiTIpJFHA.588@TK2MSFTNGP15.phx.gbl...
    > > Since when has 2005 been a leap year? In a (true) leap year, you will

    get
    > > 365.
    > >
    > > --
    > >
    > > HTH
    > >
    > > RP
    > > (remove nothere from the email address if mailing direct)
    > >
    > >
    > > "KimberlyC" <kimberchia@sbcglobal.net> wrote in message
    > > news:eHzHIBpJFHA.3076@tk2msftngp13.phx.gbl...
    > > > Hi
    > > > I have a "from" date in col A and a "to" date in Col B
    > > > In Col C, I'm using the following formula to find the days between the

    > two
    > > > dates in A and B.
    > > >
    > > > =B8-A8
    > > >
    > > > Is there something I can add to this formula to add one day to the

    > answer
    > > in
    > > > col C ....if it's a leap year.
    > > >
    > > > For example, if I have 1/1/05 in A8 and 12/31/05 in B8, the answer is
    > > > 364...and I need it to be the full year of 365 days.
    > > >
    > > > Not sure how to adjust the formula for leap year or if that is

    > possible..
    > > > Thanks in advance for you help..
    > > > Kimberly
    > > >
    > > >

    > >
    > >

    >
    >




  5. #5
    KimberlyC
    Guest

    Re: Calculating days between dates and leap years

    Becasue... when I enter 1/1/05 to 12/31/05 (I'm calc. the days worked by
    employees)... this should be a full year of 365 days that they worked ...and
    it comes up to 364 days.....



    "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
    news:O60NtGuJFHA.616@TK2MSFTNGP10.phx.gbl...
    > But why, it works fine without?
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "KimberlyC" <kimberchia@sbcglobal.net> wrote in message
    > news:ep0MFUpJFHA.4012@TK2MSFTNGP09.phx.gbl...
    > > I realized after I posted it.. I had it backwards.....but thanks for

    your
    > > help.
    > > I'll just add one to my formula..
    > >
    > >
    > >
    > > "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
    > > news:OQYiTIpJFHA.588@TK2MSFTNGP15.phx.gbl...
    > > > Since when has 2005 been a leap year? In a (true) leap year, you will

    > get
    > > > 365.
    > > >
    > > > --
    > > >
    > > > HTH
    > > >
    > > > RP
    > > > (remove nothere from the email address if mailing direct)
    > > >
    > > >
    > > > "KimberlyC" <kimberchia@sbcglobal.net> wrote in message
    > > > news:eHzHIBpJFHA.3076@tk2msftngp13.phx.gbl...
    > > > > Hi
    > > > > I have a "from" date in col A and a "to" date in Col B
    > > > > In Col C, I'm using the following formula to find the days between

    the
    > > two
    > > > > dates in A and B.
    > > > >
    > > > > =B8-A8
    > > > >
    > > > > Is there something I can add to this formula to add one day to the

    > > answer
    > > > in
    > > > > col C ....if it's a leap year.
    > > > >
    > > > > For example, if I have 1/1/05 in A8 and 12/31/05 in B8, the answer

    is
    > > > > 364...and I need it to be the full year of 365 days.
    > > > >
    > > > > Not sure how to adjust the formula for leap year or if that is

    > > possible..
    > > > > Thanks in advance for you help..
    > > > > Kimberly
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >




  6. #6
    Bob Phillips
    Guest

    Re: Calculating days between dates and leap years

    SO they work every day, no weekends off, no bank holidays or leave?

    You might want to check NETWORKDAYS from the Analysis Toolpak which
    calculates working days between two dates (and includes both dates)

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "KimberlyC" <kimberchia@sbcglobal.net> wrote in message
    news:eCpljLxJFHA.3340@TK2MSFTNGP14.phx.gbl...
    > Becasue... when I enter 1/1/05 to 12/31/05 (I'm calc. the days worked by
    > employees)... this should be a full year of 365 days that they worked

    ....and
    > it comes up to 364 days.....
    >
    >
    >
    > "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
    > news:O60NtGuJFHA.616@TK2MSFTNGP10.phx.gbl...
    > > But why, it works fine without?
    > >
    > > --
    > >
    > > HTH
    > >
    > > RP
    > > (remove nothere from the email address if mailing direct)
    > >
    > >
    > > "KimberlyC" <kimberchia@sbcglobal.net> wrote in message
    > > news:ep0MFUpJFHA.4012@TK2MSFTNGP09.phx.gbl...
    > > > I realized after I posted it.. I had it backwards.....but thanks for

    > your
    > > > help.
    > > > I'll just add one to my formula..
    > > >
    > > >
    > > >
    > > > "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
    > > > news:OQYiTIpJFHA.588@TK2MSFTNGP15.phx.gbl...
    > > > > Since when has 2005 been a leap year? In a (true) leap year, you

    will
    > > get
    > > > > 365.
    > > > >
    > > > > --
    > > > >
    > > > > HTH
    > > > >
    > > > > RP
    > > > > (remove nothere from the email address if mailing direct)
    > > > >
    > > > >
    > > > > "KimberlyC" <kimberchia@sbcglobal.net> wrote in message
    > > > > news:eHzHIBpJFHA.3076@tk2msftngp13.phx.gbl...
    > > > > > Hi
    > > > > > I have a "from" date in col A and a "to" date in Col B
    > > > > > In Col C, I'm using the following formula to find the days between

    > the
    > > > two
    > > > > > dates in A and B.
    > > > > >
    > > > > > =B8-A8
    > > > > >
    > > > > > Is there something I can add to this formula to add one day to the
    > > > answer
    > > > > in
    > > > > > col C ....if it's a leap year.
    > > > > >
    > > > > > For example, if I have 1/1/05 in A8 and 12/31/05 in B8, the answer

    > is
    > > > > > 364...and I need it to be the full year of 365 days.
    > > > > >
    > > > > > Not sure how to adjust the formula for leap year or if that is
    > > > possible..
    > > > > > Thanks in advance for you help..
    > > > > > Kimberly
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >




  7. #7
    Registered User
    Join Date
    02-02-2005
    Posts
    35

    All sounds way too complicated

    If we step back to the initial post.
    How many days between two dates?
    eg. 1/Jan/05 and 31/Dec/05

    1 Jan 05 is day 1
    31 Dec 05 is day 365
    so 365-1 is 364

    If you actually want the number of days in a year, you therefore need
    1/Jan/06 - 1/Jan/05 = 365

    and as a bonus Excel knows if it is a leap year so
    1/Jan/05 - 1/Jan/04 = 366

    If you want to work some of this out just from the year then repost

    Hope this helps

    RES

+ 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