+ Reply to Thread
Results 1 to 5 of 5

Count how many that only relate to a month date range in a column of dates

  1. #1
    Registered User
    Join Date
    05-06-2015
    Location
    Dublin, Ireland
    MS-Off Ver
    2013
    Posts
    3

    Count how many that only relate to a month date range in a column of dates

    How do i fill the table to the right, i want to a count of how many available in january. So the formule had to determine the daterange and only count how many of the available or not available or removed that only correspond with that month or date range?

    I know i can use a pivot table but i cant figure out the formula? attached example spreadsheet

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: Count how many that only relate to a month date range in a column of dates

    In F4 try
    =SUMPRODUCT(--(TEXT($A$2:$A$57,"mmmm")=$E4),--($C$2:$C$57=F$3))
    Drag down and across

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Count how many that only relate to a month date range in a column of dates

    Hi, welcome to the forum

    1. If you are using real dates, it is almost always better to stick with real dates everywhere. 1/1/2019 is a real date, but January - to excel - is just a bunch of random numbers. You could enter your months as 1/1/201/, 2/1/2019 if necessary, then just format yo show only months.
    2. Check your spelling - you have Feb spelled wrong

    3. If you must have just month names (use Pepe's suggestion or)...
    F4=COUNTIFS($A:$A,">="&DATEVALUE($E4&" 1, 2019"),$A:$A,"<="&EOMONTH(DATEVALUE($E4&" 1, 2019"),0),$C:$C,F$3)
    copied down or across.

    OR
    4. If you could use real dates...
    F4=COUNTIFS($A:$A,">="&$E4,$A:$A,"<="&EOMONTH($E4,0),$C:$C,F$3)
    copied down and across
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    05-06-2015
    Location
    Dublin, Ireland
    MS-Off Ver
    2013
    Posts
    3

    Re: Count how many that only relate to a month date range in a column of dates

    Hey Guys, Sorry for the delay in response. this is great stuff, thanks a bunch for this Peppe & FDibbins. I tried all three options, The below is more robust so far, considering i might be using a different year maybe on a different table. I changed to a date and formatted to mmmm. Im going to play around further with this though. Just thinking out loud but maybe there's was a way i could declare the year in a cell as a list dropdown in order to change the year if some my date range was in 2018 for example, is this possible to list a formulae to change the dates in column E date and keep a formatted month display?

    F4=COUNTIFS($A:$A,">="&$E4,$A:$A,"<="&EOMONTH($E4,0),$C:$C,F$3)

  5. #5
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,570

    Re: Count how many that only relate to a month date range in a column of dates

    Yes that is doable. In the attached file cell G1 displays the year based on a selection from a list of years in column M.
    Note that if there is a large range of years, say 20 or more, it may be easier to just type in the year than scroll through the drop down.
    The formula that populates the cells in column E is: =DATE(G$1,ROW(A1),1)
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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. Column chart, one data column of dates: count of month & year
    By brucemc777 in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 08-11-2016, 12:49 PM
  2. Count number of Dates in a range that match Year and month
    By the_penfool in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-13-2015, 11:49 AM
  3. Count one month in a dates range.
    By metkiki in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-28-2014, 01:51 AM
  4. Count specific dates in cell range for current month
    By rboggio1 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-22-2009, 10:21 PM
  5. count no. of dates in a column that falls on certain month & year
    By RawSugar in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-20-2005, 06:05 PM
  6. Replies: 25
    Last Post: 09-07-2005, 12:05 AM
  7. count dates within range by year and month
    By Isaiah25 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 05-04-2005, 06: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