+ Reply to Thread
Results 1 to 4 of 4

Count how many times a value appears in a year and month

  1. #1
    Forum Contributor
    Join Date
    04-22-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    329

    Count how many times a value appears in a year and month

    Hi all,
    Trying to get a formula to calculate how many times the word "NO" appears in a particular year and month, Column "A" being a series of dates going back three years, column "B" will have the word "YES" or " NO", I can calculate the amount of rows in a particular year and month but struggling with the third criteria "NO", this is what I have so far, "C1" holds the month number & "D1" the year:
    Please Login or Register  to view this content.
    Any ideas? As always, greatly appreciate any help guys - Marc
    Last edited by matrixpom; 06-14-2021 at 12:15 AM.

  2. #2
    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,944

    Re: Count how many times a value appears in a year and month

    Try using countifS() instead?

    something like...
    =countifs($A$2:$A$10000,">=1/1/2021,$A$2:$A$10000,"<=1/31/2021,$B$2:$B$10000,"NO")

    Instead of hard coding the dates, you could put them in cells and reference them
    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

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

    Re: Count how many times a value appears in a year and month

    =SUMPRODUCT((MONTH($A$2:$A$10000)=C1)*(YEAR($A$2:$A$10000)=D1)*($B$2:$B$10000="NO"))

    Or

    =SUMPRODUCT((TEXT($A$2:$A$10000,"m-yyyy")=C1&"-"&D1)*($B$2:$B$10000="NO"))
    Quang PT

  4. #4
    Forum Contributor
    Join Date
    04-22-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    329

    Re: Count how many times a value appears in a year and month

    Thanks again guys for your assistance, bebo your last option works perfect, thanks again for your help mate! Have a great day gents - Marc

+ 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 the times a variable year appears in a list of dates
    By megabolic in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-05-2018, 10:14 AM
  2. [SOLVED] Count the times a month/year appear in a list of data
    By CliffyBiro in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 03-05-2018, 11:40 PM
  3. Calculating the number of times a value appears based on Month and Year
    By achimbos in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-25-2015, 06:58 PM
  4. [SOLVED] Summarise how many times a name appears per month
    By Smally in forum Excel General
    Replies: 7
    Last Post: 08-21-2014, 10:53 AM
  5. [SOLVED] Count the number of times an A appears 5 or more times consecutively
    By CCook310 in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 10-02-2013, 04:02 PM
  6. Counting the number of times a month appears
    By Kololo in forum Excel General
    Replies: 3
    Last Post: 02-24-2012, 10:29 PM
  7. Replies: 4
    Last Post: 08-07-2006, 07:10 AM

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