+ Reply to Thread
Results 1 to 5 of 5

Count the number of time a month and year occur in a column

  1. #1
    Registered User
    Join Date
    05-28-2013
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    73

    Count the number of time a month and year occur in a column

    I am having trouble getting my formula to count the number of times a certain month and year combo occur, such as 01/16 etc in my table. The column I am trying to count if F. Currently trying to work with
    Please Login or Register  to view this content.
    and
    Please Login or Register  to view this content.
    I have used both as just enter and as arrays with ctrl shift enter.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Count the number of time a month and year occur in a column

    Try this normally entered formula
    =SUMPRODUCT((MONTH(F2:F204)=1)*(YEAR(F2:F204)=2016))-1
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Count the number of time a month and year occur in a column

    Also

    =COUNTIFS(F2:F204,">="&DATE(2016,1,1),F2:F204,"<"&DATE(2016,2,1))

  4. #4
    Registered User
    Join Date
    05-28-2013
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    73

    Re: Count the number of time a month and year occur in a column

    Both work great, now the next thing.....
    Q R S T U V W X Y Z AA
    2016 2017 2018 2019 2020 2021 2022 2023 2024 2025
    January 15 3 0 0 0 0 0 0 0 0
    February 15 6 0 0 0 0 0 0 0 0
    March 15 5 1 0 0 0 0 0 0 0
    April 17 8 2 0 0 0 0 0 0 0
    May 17 7 0 0 0 0 0 0 0 0
    June 11 6 4 0 0 0 0 0 0 0
    July 6 2 1 0 0 0 0 0 0 0
    August 14 9 3 1 0 0 0 0 0 0
    September 6 2 1 0 0 0 0 0 0 0
    October 17 5 1 0 0 0 0 0 0 0
    November 10 6 3 0 0 0 0 0 0 0
    December 7 1 0 0 0 0 0 0 0 0


    I want to be able to put in the year and month in say cells R17 and R18 respectively, is there a way for me to take this now data and have it return the number in say 1, 3, 6 months from that time point? say January 2016 should return 15, 17, and and 6 or do I need a macro for this? The data is in rows 2-14 above.

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Count the number of time a month and year occur in a column

    You can just put those cell references into the Year and Month arguments of the DATE function.
    The month needs to be a NUMBER, 1 for Jan, 2 for Feb etc.

    =COUNTIFS(F2:F204,">="&DATE(R17,R18,1),F2:F204,"<"&DATE(R17,R18+1,1))

    And you can add to the month value to out 3 months

    =COUNTIFS(F2:F204,">="&DATE(R17,R18+3,1),F2:F204,"<"&DATE(R17,R18+4,1))

    Note the month in the 2nd date is intentionally set to the month AFTER your target month.

+ 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. Replies: 5
    Last Post: 08-17-2015, 05:38 AM
  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. program a formula to count number of times event occur before a specific time.
    By yinxzon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-17-2014, 04:15 AM
  4. Replies: 2
    Last Post: 12-17-2013, 06:30 AM
  5. If Column A Month and Year = ColumnB Todays Month and Year then send email
    By HACCStaff in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-15-2013, 12:47 AM
  6. count the amount of time a combination of events occur
    By welshlad in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-19-2007, 03:43 AM
  7. [SOLVED] 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

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