+ Reply to Thread
Results 1 to 4 of 4

Number of calendar months

  1. #1
    Registered User
    Join Date
    11-30-2023
    Location
    Melbourne, Australia
    MS-Off Ver
    Office365
    Posts
    2

    Number of calendar months

    Hi, is there a simple way of calculating the number of calendar months between a range of dates.

    I have a fee that needs to be spread evenly across the date range for which it applies. I have a number of packages each having their own fee. The time frame for each is exactly 21 months, however, depending on the dates in the range, the number of months in which the range can cover can be 20 or 21. To make this clearer, a date range of 1 Jan 2023 to 31 Jan 2023 is 1 month but a date range of 10 Jan 2023 to 9 Feb 2023 which s also 1 month, crosses 2 months. I am looking for the latter.

    I solved the problem by created a flag for each month, counted the flags and used this count in the final formula for the monthly fee.

    This strikes me as messy and I am wondering of there is an easier solution.

    The file is attached.

    Thank You
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,306

    Re: Number of calendar months

    Welcome to the forum.

    If I understand correctly, I think this does what you want:

    =DATEDIF(B18,EOMONTH(C18,0)+1,"m")

    Format the cell as GENERAL before copying down.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    11-30-2023
    Location
    Melbourne, Australia
    MS-Off Ver
    Office365
    Posts
    2

    Re: Number of calendar months

    Thank you Ali. It worked perfectly.

    Michael

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,306

    Re: Number of calendar months

    Glad to have helped.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

+ 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] Notes on Calendar Months 1-12
    By crazyforexcel in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-05-2020, 02:23 PM
  2. Replies: 2
    Last Post: 07-22-2014, 02:15 AM
  3. Replies: 8
    Last Post: 02-20-2014, 05:46 PM
  4. calendar control only use months
    By gtmeloney in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-14-2009, 03:06 AM
  5. Calculating Calendar Months
    By barkaroo in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-21-2008, 02:46 PM
  6. [SOLVED] Excel - Changing value of a date by a number of calendar months
    By Sunny in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-29-2006, 04:50 AM
  7. How do I create a calendar with the months I need?
    By gottpd in forum Excel General
    Replies: 1
    Last Post: 10-05-2005, 03: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