Results 1 to 6 of 6
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Posts
    1,418
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Days in year (2003)

    Any function that will calculate the number of days in a year?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Days in year (2003)

    Say that you enter a year in cell A1. The formula
    <code>
    =365+(MOD(A1,4)=0)
    </code>
    will return the number of days in that year; it's correct for all years from 1901 to 2099. Alternatively, the formula
    <code>
    =DATE(A1+1,1,1)-DATE(A1,1,1)
    </code>
    is correct for all years from 1901 to 9998.

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Posts
    1,418
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Days in year (2003)

    What if the year is a fiscal year other than a calendar year, say October 1 through September (trying to capture a function that will automatically recognize leap years!)

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Days in year (2003)

    You can use
    <code>
    =DATE(A1+1,10,1)-DATE(A1,10,1)
    </code>
    where 10 is the number of the month the fiscal year starts (1 = January, 2 = February etc.)

  5. #5
    Platinum Lounger
    Join Date
    Jan 2001
    Posts
    3,788
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Days in year (2003)

    You can also use the DATEDIF function, for more info see http://www.cpearson.com/excel/datedif.aspx

  6. #6
    Bronze Lounger
    Join Date
    Jan 2001
    Posts
    1,418
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Days in year (2003)

    Thanks to all!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •