+ Reply to Thread
Results 1 to 8 of 8

Need help with countif with multiple criteria?

  1. #1
    Registered User
    Join Date
    01-20-2012
    Location
    Baltimore, MD
    MS-Off Ver
    Google Docs
    Posts
    5

    Need help with countif with multiple criteria?

    I have two collumns:
    A B
    YEAR MONTH
    2006 June
    2006 June
    2007 Sept
    2008 october
    2006 January
    2006 Februrary
    2007 March
    2008 March

    On a separate sheet I have:
    Year 2006
    Month jan feb mar apr may jun jul aug sep oct nov
    #instances ? ? ? ? ? ? ? ? ? ? ?

    Now what function would grab only the 2006 year data and COUNT the number of Januarys?
    ***I would also like it to grab the entire collumn because the data sheet is constantly being updated.

    Thank you soooo much!

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Need help with countif with multiple criteria?

    Hi
    Have you tried =COUNTIF()
    e.g.
    =COUNTIFS(A:A,2006,B:B,"January")

    If you change the horizontal list of abbreviated month names (assumed to be starting in B2) you could then use, (assuming 2006 is in say B1)

    =COUNTIFS(A:A,B1,B:B,B$2)
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    01-20-2012
    Location
    Baltimore, MD
    MS-Off Ver
    Google Docs
    Posts
    5

    Re: Need help with countif with multiple criteria?

    =countif(Sheet1!$DE$2:$DE$13,"*" & I2 & "*") I2= aug

    I got that to work but I had to manually select the 2006 data :/

    I will try countifs and see if that helps

  4. #4
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Need help with countif with multiple criteria?

    Hi Kaamakazi,

    Welcome to the forum.

    See the attachment where I have transferred your scenario and provided a solution.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    Attached Files Attached Files
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  5. #5
    Registered User
    Join Date
    01-20-2012
    Location
    Baltimore, MD
    MS-Off Ver
    Google Docs
    Posts
    5

    Re: Need help with countif with multiple criteria?

    I should have mentioned this before but I am using google docs.
    It has many many many of the same functions. It has COUNTIF but not COUNTIFS...

  6. #6
    Registered User
    Join Date
    01-20-2012
    Location
    Baltimore, MD
    MS-Off Ver
    Google Docs
    Posts
    5

    Re: Need help with countif with multiple criteria?

    Thank you dilipandey, but countifs doesn't work on goolge docs :/... You guys probably hate me now. Is there another way to do it with sumproduct or something?

  7. #7
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Need help with countif with multiple criteria?

    Hi Kaamakazii,

    Apply following formula in my attachment at g3 and drag it towards right.
    Please Login or Register  to view this content.
    Note:- Above is an array formula and need to be confirmed with Ctrl Shift Enter.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  8. #8
    Registered User
    Join Date
    01-13-2012
    Location
    New Hampshire
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Need help with countif with multiple criteria?

    Will this work:

    =SUMPRODUCT(($A$2:$A$9>=$D$1) * ($A$2:$A$9<=$D$2) * ($B$2:$B$9 = "January"))

    Where D1 and D2 are your start and end dates? If you just want to calculate 2006 you would enter 2006 in both cells. There's probably a better way but this is the way I would do it.

    And of course instead of writing "January" you could set up rows with each month in it and reference them.

    I don't know anything about googledocs so maybe this is not an option.

    Good luck!
    ~Amy

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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