+ Reply to Thread
Results 1 to 3 of 3

Count the number of days that fall within a particular month.

  1. #1
    Forum Contributor Portuga's Avatar
    Join Date
    02-20-2004
    Location
    Portugal
    MS-Off Ver
    365
    Posts
    852

    Count the number of days that fall within a particular month.

    Hi guys,

    I would like a formula or other method that would give me the amount of days that fall within a particular month based on a start date and a end date.

    For example:

    Please Login or Register  to view this content.
    I would like to know that 5 days belong to February and 3 days to March.

    Thanks in advance
    If you found the solution to your question. Mark the thread as "Solved"
    Thank everyone that helped you with a valid solution by clicking on their

    There is no such thing as a problem, only a temporary lack of a solution

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967
    Try this user defined function which you should paste into a blank module

    Please Login or Register  to view this content.
    Then call this in the sheet, for example, for March

    =DaysInMonth(A1,B1,3)
    Martin

  3. #3
    Forum Contributor Portuga's Avatar
    Join Date
    02-20-2004
    Location
    Portugal
    MS-Off Ver
    365
    Posts
    852
    Excellent!

    Thanks a mill mrice

  4. #4
    all4excel
    Guest

    U can get an Excel Solution like this...

    Portuga,

    U can get an Excel Solution like this...

    If your Starting Date and End Dates are in cells A2 and B2 then you can use the following formula.

    [ ="There are "&(DATE(YEAR($A$2),MONTH($A$2)+1,0)-$A$2+1)& " days in the month of "&CHOOSE(MONTH($A$2),"Jan","Feb","Mar","Apr","May","June","July","Aug","Sep","Oct","Nov","Dec")&" and "& $B$2-DATE(YEAR($B$2),MONTH($B$2),1)+1&" days in the month of "& CHOOSE(MONTH($B$2),"Jan","Feb","Mar","Apr","May","June","July","Aug","Sep","Oct","Nov","Dec")&"." ].

    Please let me know if this works for you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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