+ Reply to Thread
Results 1 to 5 of 5

Count if with Multiple conditions

  1. #1
    Registered User
    Join Date
    09-02-2008
    Location
    London
    Posts
    73

    Count if with Multiple conditions

    Hi,

    I have 2 columns, A has names and B has yes or no in it.

    I need to count the number of times a particular name appears in A where B=Yes.

    I've tried every variation of CountIF I can think of and even tried sums with embedded IF's... nothing seems to work.

    Any help is appreciated!!

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    =sumproduct((a$1:$a$100="name")*($b$1:$b$100="yes"))

  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try

    =SUMPRODUCT((A2:A10="Name")*(B2:B10="yes"))
    Change "Name" to the Name and range to suit

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  4. #4
    Registered User
    Join Date
    09-02-2008
    Location
    London
    Posts
    73
    Thats great! Works perfectly thanks.

    Can I just ask why does multiplying the two conditions create the correct answer?

  5. #5
    Forum Contributor EdMac's Avatar
    Join Date
    01-23-2006
    Location
    Exeter, UK
    MS-Off Ver
    2003
    Posts
    1,264
    See this link which is the bible for SUMPRODUCT


    http://www.xldynamic.com/source/xld.SUMPRODUCT.html
    Ed
    _____________________________
    Always learning, but never enough!
    _____________________________

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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