+ Reply to Thread
Results 1 to 9 of 9

Counting days in each month for a period of dates (e.g. 8 Jan to 19 Apr)

  1. #1
    Registered User
    Join Date
    03-02-2021
    Location
    Hong Kong
    MS-Off Ver
    Windows 10 Pro
    Posts
    4

    Counting days in each month for a period of dates (e.g. 8 Jan to 19 Apr)

    I have a list of period of dates and wish to have a day count of each month consolidated for all the periods.

    e.g.
    Column 1:
    8 Jan
    9 Feb
    16 Mar
    19 Mar

    Column 2:
    19 Apr
    18 Mar
    20 Jul
    30 Aug
    *HOWEVER, this date is not account as a value
    (e.g. for the first period of 8 Jan to 19 Apr, 18 Apr is counted, but 19 Apr is not counted as a day)

    This is the result I seek:
    Jan = A number of days accumulated in all above 4 periods of dates
    Feb = B number of days
    Mar = C number of days
    Apr = D
    May = E
    Jun = F
    Jul = G
    etc.

    Thank you very much.

    kyc

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,459

    Re: Counting days in each month for a period of dates (e.g. 8 Jan to 19 Apr)

    With this kind of data, SUMIFS/SUMPRODUCT may help. Try them.

    If you can not put an end, try to upload a sample worksheet.
    Quang PT

  3. #3
    Registered User
    Join Date
    03-02-2021
    Location
    Hong Kong
    MS-Off Ver
    Windows 10 Pro
    Posts
    4

    Re: Counting days in each month for a period of dates (e.g. 8 Jan to 19 Apr)

    i uploaded the file from my computer onto "Manage Attachments", but afterwards I cannot select it in "Attachments" Icon in the reply message.

    I think it already is attached however.

    Otherwise, does this link work?
    excelforum.com/attachment.php?attachmentid=721530&stc=1&d=1614749261

    I do not know how to use sumifs, very basic user.

    Thanks.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Counting days in each month for a period of dates (e.g. 8 Jan to 19 Apr)

    In B7 then copied across.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  5. #5
    Registered User
    Join Date
    03-02-2021
    Location
    Hong Kong
    MS-Off Ver
    Windows 10 Pro
    Posts
    4

    Re: Counting days in each month for a period of dates (e.g. 8 Jan to 19 Apr)

    Thank you.

    When i viewed your formula, it turned into "Error" after clicking out of it (without any amendment).

    I have tried it on my own as well but it shows the same (attached).

    Could you identify where is the error from, so that I know what to look out for on my own worksheet?

    Thank you.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,152

    Re: Counting days in each month for a period of dates (e.g. 8 Jan to 19 Apr)

    Enter the formula with CTRL+SHIFT+ENTER

    Hold down CTRL and SHIFT keys then press ENTER: you will see { } brackets rounnd the formula

    Error in formula: missing term

    =SUM(($G$6:$G$10<=EOMONTH(C$2,0))*($H$6:$H$10>=C$2)*(IF($H$6:$H$10>=EOMONTH(C$2,0),EOMONTH(C$2,0),$H$6:$H$10-1)-IF($G$6:$G$10<=C$2,C$2,$G$6:$G$10)+1))
    Attached Files Attached Files
    Last edited by JohnTopley; 03-03-2021 at 06:54 AM.

  7. #7
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Counting days in each month for a period of dates (e.g. 8 Jan to 19 Apr)

    Formula is ARRAY formula not ordinary formula.
    To enter ARRAY formula
    Copy and paste the formula in cell
    Press F2
    Press Ctrl+Shift+Enter together
    Excel covers the formula with {}.

  8. #8
    Registered User
    Join Date
    03-02-2021
    Location
    Hong Kong
    MS-Off Ver
    Windows 10 Pro
    Posts
    4

    Re: Counting days in each month for a period of dates (e.g. 8 Jan to 19 Apr)

    Magic! Thank you works wonders!

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,152

    Re: Counting days in each month for a period of dates (e.g. 8 Jan to 19 Apr)

    Can you please mark as SOLVED (see Thread Tools at to of page.

+ 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] Count days in a rolling 12 month period
    By mlafrance in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-30-2023, 07:45 AM
  2. Count of Days per month for a contract period
    By sspilla in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-14-2020, 11:58 AM
  3. Count days per month within a period
    By Cunner in forum Excel General
    Replies: 4
    Last Post: 02-03-2014, 06:12 AM
  4. Replies: 10
    Last Post: 01-09-2014, 07:04 PM
  5. Counting days stayed during certain time period
    By analystEK in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-10-2013, 05:00 PM
  6. Calculating number of days in each month during a given period.
    By josnah in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-28-2007, 02:52 AM
  7. [SOLVED] Days in month for 10 year period
    By Geoff in forum Excel General
    Replies: 4
    Last Post: 05-06-2005, 12:06 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