+ Reply to Thread
Results 1 to 3 of 3

Requesting help with date function

  1. #1
    Registered User
    Join Date
    11-05-2012
    Location
    Colorado
    MS-Off Ver
    Excel 2010
    Posts
    1

    Requesting help with date function

    Hi all,

    I need some help writing a date formula. I have two columns, Column W with a start date, Column X with an end date. I want to calculate the number of days between the two and return them by what is related to a particular year (3 columns, one each for 2012, 2013 & 2014). Does anyone know if this is possible?

    Thank you so much,
    K

  2. #2
    Registered User
    Join Date
    10-22-2012
    Location
    United States
    MS-Off Ver
    Excel 2007, 2010, 2011
    Posts
    4

    Re: Requesting help with date function

    Kitkatlv,

    If I understand what you're trying to do correctly then I think the following is what you're after. If this isn't what you're try to do, then maybe you could post more details or an example spreadsheet.


    Start Date End Date Total Days 2012 Days 2013 Days 2014 Days
    1/1/2012 11/30/2014 1064 365 365 334
    3/1/2012 7/15/2013 501 305 196 0
    6/1/2012 9/20/2012 111 111 0 0
    12/1/2012 12/31/2014 760 30 365 365
    =B2-A2 =IF($B2<DATE(2012,12,31),$B2-$A2,DATE(2012,12,31)-$A2) =IF($B2<DATE(2013,12,31),$B2-$A2,DATE(2013,12,31)-$A2)-D2 =IF($B2<DATE(2014,12,31),$B2-$A2,DATE(2014,12,31)-$A2)-D2-E2

  3. #3
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Requesting help with date function

    A2: Start Date
    B2: End Date

    C1 to across enter years. 2012, 2013, 2014 etc..

    In C2

    =MAX(0,MIN($B2,DATE(C$1,12,31))-MAX($A2,DATE(C$1,1,1))+1)

    Then copy down & across. If you don't want to include start day, remove +1 at the end.
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

+ 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