+ Reply to Thread
Results 1 to 6 of 6

Calculate Days Between (DAYS360) Including Start Date

  1. #1
    Registered User
    Join Date
    06-02-2023
    Location
    Evansville, Indiana
    MS-Off Ver
    Office 365
    Posts
    7

    Calculate Days Between (DAYS360) Including Start Date

    Hello,

    I have an inquiry regarding calculating the number of days between two dates, using DAYS360, when all months are assumed to be 30 days. For reference, we bill all months as 30days, 360 days a year. That being said there are a couple exceptions regarding February.

    • If the Start Date <= February 1 and the End Date = February 28, February is considered to have 30 days, plus the number of days from the Start Date, i.e. 1/15/2023 - 2/28/2023 = 46 days, or 2/01/2023 - 2/28/2023 = 30 days.
    • If the Start Date >= February 2 and the End Date is <= February 28 then February is calculated by actual days, i.e. 2/2/2023 - 2/28/2023 = 27 days.
    • If the Start Date = February 28 and the End Date > February 28, then February is considered to have 3 days, plus the number of days until the End Date, i.e. 2/28/2023 - 3/15/2023 = 18 days.

    I have tried using a simple =DAYS360($A2,$B2)+1 but the results vary, depending on the month. 10/01/2022 - 12/31/2022 should be 90 days, but DAYS360 +1 make it 91, whereas 10/01/2022 - 9/30/2023 calculates 359 if I don't put the +1 to include the Start Date.

    Additionally, I have tried using =DAYS360($A2,$B2)+(IF(AND(MONTH($B2)=2,DAY($B2)=28),2,0))+1, which works to an extent, but I run into the same issues described above.

    Any help is greatly appreciated and all notes are contained here and in the spreadsheet.
    Attached Files Attached Files
    Last edited by Sparky156; 07-06-2023 at 03:20 PM.

  2. #2
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,706

    Re: Calculate Days Between (DAYS360) Including Start Date

    you don't provide examples for leap years however, given O365, perhaps below would work for you ?

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    the above would "spill" the 13 results into F2:F14 (mirroring expected values)
    Last edited by XLent; 07-07-2023 at 05:14 AM. Reason: corrected G2 to reflect OP file

  3. #3
    Registered User
    Join Date
    06-02-2023
    Location
    Evansville, Indiana
    MS-Off Ver
    Office 365
    Posts
    7

    Re: Calculate Days Between (DAYS360) Including Start Date

    Good morning,

    I haven't been with my organization through a leap year, but the concept should remain the same as the examples above. If the Start Date is February 29, then it would add two days to include the Start Date and February 30. However, I believe there are controls in place that prevent Start Dates from occurring on February 29 due to background processes, such as these. If February 29, why not February 28? Why not March 1?

    What is "s", "e", and "m" in this equation? I have never seen or used these before.
    Last edited by AliGW; 07-07-2023 at 06:55 AM. Reason: Please do NOT quote unnecessarily!

  4. #4
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,706

    Re: Calculate Days Between (DAYS360) Including Start Date

    s, e & m are just "variables" within the LET -- s(tart dates), e(end dates), m(onths)

    I would say that the formula provided should work for leap-years however, worth calling just in case there are any other nuances (not previously disclosed).

  5. #5
    Registered User
    Join Date
    06-02-2023
    Location
    Evansville, Indiana
    MS-Off Ver
    Office 365
    Posts
    7

    Re: Calculate Days Between (DAYS360) Including Start Date

    Quote Originally Posted by XLent View Post
    s, e & m are just "variables" within the LET -- s(tart dates), e(end dates), m(onths)

    I would say that the formula provided should work for leap-years however, worth calling just in case there are any other nuances (not previously disclosed).
    Thank you for that, I appreciate it. I tested it out on the Workbook I previously attached and it worked great, so thank you!

    However, the issue I am running into is that in the Master Workbook this information comes from, each page has a Table where this information is contained in. I could do a hidden cell that calculates everything and then do an =Cell for reference, but having something in the table is more beneficial.

    The other issue I am running into is in the attached, v2 of the Working Copy. I am running into several instances where 10/01/2022 - 03/01/2023 is being calculated as 180 days, as it is referencing the entire month of March. Another examples is 10/24/2022 - 09/21/2023 is calculated as 307 days when it is actually 328.

    Any further suggestions are greatly appreciated.
    Attached Files Attached Files

  6. #6
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: Calculate Days Between (DAYS360) Including Start Date

    Is this correct?

    And how many days are
    31 May to June 1 (2 or 1?),
    31 May to 31 May (1 or 0?) and
    31 May to 30 June (31 or 30?)

    30 May to 1 June = 2 days
    31 May to 1 June = ? days
    1 June to 1 June = 1 day

    30 May to 30 June = 31 days
    31 May to 30 June = ? days
    1 June to 30 June = 30 days

    1 May to 31 May = 30 days
    2 May to 31 May = 29 days
    29 May to 31 May = 2 days
    30 May to 31 May = 1 day
    31 May to 31 May = ? days

+ 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. Replies: 10
    Last Post: 02-29-2024, 08:55 AM
  2. Replies: 16
    Last Post: 09-12-2020, 01:32 PM
  3. Replies: 4
    Last Post: 07-24-2017, 03:06 PM
  4. [SOLVED] To calculate number of days including start date
    By gautham_p in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 05-11-2016, 10:47 AM
  5. Replies: 14
    Last Post: 04-06-2015, 09:19 PM
  6. Counting number of days, including start date, without using +1
    By Crappy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-07-2014, 05:05 AM
  7. Calculate End Date Using Start Date and No. of Days excluding specific days.
    By SinusxCosinusx in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-22-2013, 05:48 AM

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