+ Reply to Thread
Results 1 to 8 of 8

Calculate how many days in a year that falls between two dates

  1. #1
    Registered User
    Join Date
    02-09-2015
    Location
    London
    MS-Off Ver
    2013
    Posts
    92

    Calculate how many days in a year that falls between two dates

    Hi all,

    I have two dates - a start date (cell A1) and an end date (cell B1)

    I then have years 2016, 2017, 2018 etc in cells C1 onwards.

    I need a calculation that provides the numbers of days underneath each year that falls into those two dates.

    So for example, if the start date is 01 June 2016, and the end date is 31 Jan 2018, it would look like this:

    2016: 210 (01 June to 31 December)
    2017: 365 (whole year)
    2018: 31 (01 to 31 Jan)

    Is there a calculation that can perform this? I've tried, and failed.

    Thanks

  2. #2
    Forum Contributor
    Join Date
    01-09-2016
    Location
    Perth Western Australia
    MS-Off Ver
    Office 365
    Posts
    257

    Re: Calculate how many days in a year that falls between two dates

    Hi

    I have attached a spreadsheet with a formula that may help

    Cheers
    Attached Files Attached Files

  3. #3
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Calculate how many days in a year that falls between two dates

    I think there is 214 days in 2016 if yes try below formula
    Please Login or Register  to view this content.
    and copy towards down
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Calculate how many days in a year that falls between two dates

    Try this...

    Data Range
    A
    B
    C
    D
    E
    F
    G
    H
    1
    Start
    End
    2015
    2016
    2017
    2018
    2019
    2020
    2
    3/27/2016
    12/1/2018
    0
    280
    365
    335
    0
    0


    This formula entered in C2 and copied across:

    =MAX(0,MIN(DATE(C1+1,1,1),$B2+1)-MAX(DATE(C1,1,1),$A2))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    02-09-2015
    Location
    London
    MS-Off Ver
    2013
    Posts
    92

    Re: Calculate how many days in a year that falls between two dates

    Thank you very much. The problem is that I'm working in Excel 2007, is there any way of achieving this in Excel 2007? The =DAYS function isn't supported, sadly.

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,191

    Re: Calculate how many days in a year that falls between two dates

    Use the DATE formulas provided Tony and Siva

  7. #7
    Registered User
    Join Date
    02-09-2015
    Location
    London
    MS-Off Ver
    2013
    Posts
    92

    Re: Calculate how many days in a year that falls between two dates

    Thank you Tony Valko, that worked perfectly!

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Calculate how many days in a year that falls between two dates

    You're welcome. Thanks for the feedback!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] calculate total number of days between two days based on 365 days year
    By aparunkumar in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 03-14-2016, 12:51 AM
  2. Replies: 4
    Last Post: 04-02-2015, 03:19 AM
  3. Replies: 7
    Last Post: 12-24-2014, 05:03 PM
  4. Replies: 1
    Last Post: 12-24-2014, 03:52 PM
  5. Replies: 15
    Last Post: 06-03-2014, 02:08 PM
  6. Replies: 4
    Last Post: 11-28-2011, 06:21 AM
  7. count no. of dates in a column that falls on certain month & year
    By RawSugar in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-20-2005, 06:05 PM

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