+ Reply to Thread
Results 1 to 9 of 9

Help with categorizing a period into month and days

Hybrid View

  1. #1
    Registered User
    Join Date
    07-13-2022
    Location
    london
    MS-Off Ver
    2018
    Posts
    3

    Help with categorizing a period into month and days

    Hi, i would like some guidance to make an excel that the user inputs a period like 12/2/2022-5/4/2022 and the excel categorize it into seperate months with the days in the next cell. For example for the previous period :February 17days//March 31days//April 5days. Any help will be appreciated.Thanks in advance
    Attached Files Attached Files
    Last edited by konstantinos1253; 07-14-2022 at 03:36 PM.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,852

    Re: Help with categorizing a period into month and days

    Welcome to the forum.

    Have you got a sample workbook you can share with us (by following the guidelines in the yellow banner at the top of the screen), so we can see what cells you are using and how the output should be arranged?

    Pete

  3. #3
    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,519

    Re: Help with categorizing a period into month and days

    With Start date in A2 and End date in B2

    with C1

    01/01/2022 then D1

    =EOMONTH(C1,0)+1 and copy across

    in C2

    =IF(EOMONTH($A2,0)=EOMONTH(C$1,0),EOMONTH($A2,0)-$A2+1,IF(EOMONTH($B2,0)=EOMONTH(C$1,0),$B2-EOMONTH($B2,-1),IF(AND(C$1>$A2,C$1<$B2),EOMONTH(C$1,0)-EOMONTH(C$1,-1),0)))

    copy across
    Last edited by JohnTopley; 07-14-2022 at 04:56 PM.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  4. #4
    Registered User
    Join Date
    07-13-2022
    Location
    london
    MS-Off Ver
    2018
    Posts
    3

    Re: Help with categorizing a period into month and days

    I attached the file
    Attached Files Attached Files

  5. #5
    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,519

    Re: Help with categorizing a period into month and days

    in B5

    =IF(EOMONTH($A$2,0)=EOMONTH($A5,0),EOMONTH($A$2,0)-$A$2+1,IF(EOMONTH($B$2,0)=EOMONTH($A5,0),$B$2-EOMONTH($B$2,-1),IF(AND($A5>$A$2,$A5<$B$2),EOMONTH($A5,0)-EOMONTH($A5,-1),0)))

  6. #6
    Registered User
    Join Date
    07-13-2022
    Location
    london
    MS-Off Ver
    2018
    Posts
    3

    Re: Help with categorizing a period into month and days

    It does not work for me .It shoes just a 0 in b5

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2405
    Posts
    13,427

    Re: Help with categorizing a period into month and days

    First convert your text months to numeric dates. In A5 1/2022 would be fine for the first date. Then in A6
    Formula: copy to clipboard
    =EDATE(A5,1)
    and copy down.

    Try this in B5 and copy down.
    Formula: copy to clipboard
    =INDEX(FREQUENCY(ROW(INDIRECT(A$2&":"&B$2)),EOMONTH(A5,{-1,0})),2)
    Dave

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2405
    Posts
    13,427

    Re: Help with categorizing a period into month and days

    Another way in B5 and copied down.
    Formula: copy to clipboard
    =MAX(0,MIN(INDEX(IF(MUNIT(2),EOMONTH(A5,{-1,0})+{1,0},A$2:B$2),,2))-
    MAX(INDEX(IF(MUNIT(2),EOMONTH(A5,{-1,0}),A$2:B$2),,1))+
    (EOMONTH(A5,-1)=EOMONTH(A$2,-1)))

  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,519

    Re: Help with categorizing a period into month and days

    Doesn't work ?? See attached
    Attached Files Attached Files

+ 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. [SOLVED] How to Extract days in a given month from a given period?
    By Treklogg in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-25-2022, 04:57 PM
  3. [SOLVED] Find days of a month in a period from - to
    By Berna11 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-22-2022, 02:06 PM
  4. Counting days in each month for a period of dates (e.g. 8 Jan to 19 Apr)
    By korykyc in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-04-2021, 02:55 AM
  5. 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
  6. Count days per month within a period
    By Cunner in forum Excel General
    Replies: 4
    Last Post: 02-03-2014, 06:12 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

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