+ Reply to Thread
Results 1 to 4 of 4

Calculating Dates Between Months

  1. #1
    Registered User
    Join Date
    06-27-2017
    Location
    South Carolina
    MS-Off Ver
    Excel 13
    Posts
    3

    Calculating Dates Between Months

    Hi, Thank you for clicking. I am working on a project where I need to calculate the amount of days impacted in prior or future months for altered contracts. The accounting team doesn't need to know about contract adjustments in the current month, but they need to know how much money to adjust for the previous or next month after a contract start/end date changes. To put it in perspective, I work for an equipment rental company and often we alter contracts due to equipment breakdowns or customer delays. They might have wanted to rent something that day and we have a contract they agreed to, but then the weather calls for rain and they delay a few days. We alter the contract as opposed to zeroing out the contract and re-typing. I need to write a formula which will capture the following in a cell so accounting has more visibility into the true revenue every month:

    -If a contract is written on 6/1 and backdated to 5/30, the cell needs to say "2" since 2 days were added to the previous month.

    -If a contract was written on 6/5 and backdated to 6/1, the cell should say "0" because the prior month was not impacted.

    -If a contract was written on 6/1 and backdated to 4/1, the cell should say "61" since May and April were impacted.

    -If a contract was written on 6/5 and backdated to 4/1, it would still need to say "61" because only the closed books from May and April were impacted.

    -If a contract was written on 6/30 and forward-dated to 7/2, the cell should say "2" because 2 days were impacted in the next month.

    -If a contract was written on 6/1 and forward-dated to 6/5, the cell should say "0" since it is still in the current month's open books.

    -If a contract was written for 6/1 and forward-dated to 8/1, the cell should say "32" because all of July and August were impacted.

    -If a contract was written on 6/5 and forward-dated to 8/1, the cell should still say "32" because that's the amount of days in the next months that were impacted.

    Attached is the file with my desired outputs as explained above. You guys are unsung heroes. I will try and contribute as much to this page as possible, because my new job requires so much Excel hopefully I can learn it a lot and help other people on here.
    Attached Files Attached Files
    Last edited by BizProcessGuy; 06-28-2017 at 09:48 AM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Calculating Dates Between Months

    Shouldn't the last two be 32 and not 61. Only the first of August is impacted.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    06-27-2017
    Location
    South Carolina
    MS-Off Ver
    Excel 13
    Posts
    3

    Re: Calculating Dates Between Months

    Yes thank you, it has been corrected.

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Calculating Dates Between Months

    In C2 copied down

    =IF(MONTH(A2)=MONTH(B2),0,IF(B2>A2, B2-EOMONTH(A2,0),(EOMONTH(A2,-1)-B2+1)))

+ 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] Calculating number of Months between two dates by Year
    By ajalfonso in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-23-2017, 03:39 PM
  2. [SOLVED] calculating total months from 2 different dates
    By masonutley in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-02-2015, 06:39 PM
  3. [SOLVED] Calculating Number of Months between two given dates
    By InterstateRentals in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-09-2013, 10:15 AM
  4. Replies: 1
    Last Post: 07-28-2011, 04:58 AM
  5. calculating difference in months between 2 dates
    By RealEstateFinan in forum Excel General
    Replies: 3
    Last Post: 07-11-2007, 03:15 PM
  6. Calculating # of Months B/T Dates
    By S Jackson in forum Excel General
    Replies: 5
    Last Post: 02-01-2006, 05:40 AM
  7. Calculating Dates in Terms of Months
    By Jessica in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-20-2005, 02:05 PM

Tags for this Thread

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