+ Reply to Thread
Results 1 to 12 of 12

Count total number of months, not counting overlapping months

  1. #1
    Registered User
    Join Date
    05-31-2022
    Location
    Malay
    MS-Off Ver
    2010
    Posts
    3

    Count total number of months, not counting overlapping months

    Hi I need help to calculate the total number of months in the spreadsheet, not counting the overlapping months. I have attached the spreadsheet for easy reference.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: Count total number of months, not counting overlapping months

    Hope this help.

    Identify days overlapping:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Count days overlapping:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

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

    Re: Count total number of months, not counting overlapping months

    If you update to Excel 365 this formula is possible

    Please try for the different days:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: Count total number of months, not counting overlapping months

    Great formula Hans, but your result diverge from mine 1029 <> 1033, if taking out the +1 of your formula the result gets close to mine.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Do you have any consideration for this divergent results?

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

    Re: Count total number of months, not counting overlapping months

    1033 is correct.

    In 2022: From 1 Jan to 31 Dec = 365 days
    In 2023: From 1 Jan to 31 Dec = 365 days
    In 2024: From 2 Sep to 31 Dec = 121 days (29 in Sept, 31 in Okt, 30 in Nov and 31 in Dec)
    In 2000: From 1 Jan to 30 Jun = 182 days (31 in Jan, 29 in Feb, 31 in Mar, 30 in Apr, 31 in May and 30 in Jun)

    365+365+121+182 = 1033.

    @DJunqueira, in your formula you don't include the last day of each period.
    Last edited by HansDouwe; 01-18-2024 at 02:09 AM.

  6. #6
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,406

    Re: Count total number of months, not counting overlapping months

    Array formulas
    days
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    months
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    No array formulas
    days
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    months
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Czeslaw; 01-18-2024 at 06:01 AM.

  7. #7
    Registered User
    Join Date
    05-31-2022
    Location
    Malay
    MS-Off Ver
    2010
    Posts
    3

    Re: Count total number of months, not counting overlapping months

    Quote Originally Posted by Czeslaw View Post
    Array formulas
    days
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    months
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    No array formulas
    days
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    months
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    This cannot work as it counted the overlapping months.

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

    Re: Count total number of months, not counting overlapping months

    And what about the other 2 solutions?

  9. #9
    Registered User
    Join Date
    05-31-2022
    Location
    Malay
    MS-Off Ver
    2010
    Posts
    3

    Re: Count total number of months, not counting overlapping months

    Quote Originally Posted by HansDouwe View Post
    And what about the other 2 solutions?
    your solution works fine. I will do more sample checks on other years as well. Thanks so much!

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

    Re: Count total number of months, not counting overlapping months

    You are Welcome!

    Thanks for the feedback. Glad to have helped. .

    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.

  11. #11
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: Count total number of months, not counting overlapping months

    Quote Originally Posted by HansDouwe View Post
    1033 is correct.
    In 2022: From 1 Jan to 31 Dec = 365 days
    In 2023: From 1 Jan to 31 Dec = 365 days
    In 2024: From 2 Sep to 31 Dec = 121 days (29 in Sept, 31 in Okt, 30 in Nov and 31 in Dec)
    In 2000: From 1 Jan to 30 Jun = 182 days (31 in Jan, 29 in Feb, 31 in Mar, 30 in Apr, 31 in May and 30 in Jun)
    365+365+121+182 = 1033.
    @DJunqueira, in your formula you don't include the last day of each period.
    Right, right, some how it isn't 'my' formula, I just blindly credit Excel to count. hummm.
    Tks for wake me up for this obvious matter.

  12. #12
    Forum Contributor
    Join Date
    10-22-2022
    Location
    Santa Cruz, Bolivia
    MS-Off Ver
    MSO 365
    Posts
    157

    Re: Count total number of months, not counting overlapping months

    hi everyone, I allow me to propose another possible solution (assuming periods less than 365 days):

    Please Login or Register  to view this content.
    In case you need considering more large periods, only need to edit the ROW expression.

    I hope it result useful.

+ 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. Counting the number of months before a certain months in a cell
    By Ikie86 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-19-2023, 03:47 AM
  2. Count overlapping months from date ranges
    By jasonnj1978pwest in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-18-2017, 04:53 PM
  3. [SOLVED] Excel Formula/Function to find total number of non-overlapping months
    By akynyemi in forum Excel General
    Replies: 6
    Last Post: 09-07-2015, 06:15 PM
  4. Replies: 2
    Last Post: 07-22-2014, 02:15 AM
  5. Counting Total Months
    By anthonystole in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-31-2014, 03:39 AM
  6. Replies: 2
    Last Post: 03-19-2014, 07:26 PM
  7. Replies: 8
    Last Post: 02-20-2014, 05:46 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