+ Reply to Thread
Results 1 to 8 of 8

Thread: 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 Richard Buttrey's Avatar
    Join Date
    02-15-2008
    Location
    Grappenhall, UK
    MS-Off Ver
    Excel for Windows & Mac - all versions.
    Posts
    6,566

    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

    If this was useful then please rate it appropriately.

    Click the small star icon at the bottom left of my 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
    Valued Forum Contributor dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    New Delhi, India
    MS-Off Ver
    Excel 1997, 2000, XP, 2003, 2007, 2010
    Posts
    2,398

    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
    +919810929744
    dilipandey@gmail.com

  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
    Valued Forum Contributor dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    New Delhi, India
    MS-Off Ver
    Excel 1997, 2000, XP, 2003, 2007, 2010
    Posts
    2,398

    Re: Need help with countif with multiple criteria?

    Hi Kaamakazii,

    Apply following formula in my attachment at g3 and drag it towards right.
    {=SUM(--($A$2:$A$9=$G$1)*($B$2:$B$9=G$2))}
    Note:- Above is an array formula and need to be confirmed with Ctrl Shift Enter.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey
    +919810929744
    dilipandey@gmail.com

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

    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.2.0