+ Reply to Thread
Results 1 to 3 of 3

Chain of multiple COUNTIFS - any way of using a range or something faster?

  1. #1
    Registered User
    Join Date
    10-19-2013
    Location
    England
    MS-Off Ver
    Excel 2007/2010
    Posts
    10

    Question Chain of multiple COUNTIFS - any way of using a range or something faster?

    Hi.
    I have a whole bunch of output indicators that increment based on matching two conditions in two columns of data.
    Simple enough to do where "if cell1=x and cell2=y, count", but i hit a problem when the match criteria (ie. "y") is a range of values.
    Example of what works:
    Please Login or Register  to view this content.
    You may note that Calculations!$H$2 to Calculations!$H$5 is the range I'm searching for in column G

    It's fine for just a couple of lookups, but when I'm using this formula in about 30 cells (all looking for different strings), there's a noticable slowdown!

    Any way of refining this? Particularly with regard to speed, but I'll settle for simplicity! (Doesn't have to be COUNTIF - is SUMPRODUCT any faster?)

    I've tried using a named range; eg.
    Please Login or Register  to view this content.
    but that doesn't give the same output (presumably it's looking for ALL the values?)

    Thanks for any suggestions! :-)

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Chain of multiple COUNTIFS - any way of using a range or something faster?

    You can use a single COUNTIFS with the whole range as the criteria - that will return an "array" of results, one for each value in the range, so you then use a function like SUMPRODUCT to sum that array, i.e.

    =SUMPRODUCT(COUNTIFS($H:$H,$A24,$G:$G,Calculations!$H$2:$H$5))
    Audere est facere

  3. #3
    Registered User
    Join Date
    10-19-2013
    Location
    England
    MS-Off Ver
    Excel 2007/2010
    Posts
    10

    Re: Chain of multiple COUNTIFS - any way of using a range or something faster?

    Thanks. That looked a lot better.
    I was still hoping for an option that used a range, so I tried it anyway. Then I tried it with a named range and it worked! so perfect!
    Please Login or Register  to view this content.
    Main reason for preferring a named range was so it's simpler to move the criteria around. The speed I'll have to live with!

    Thanks again! :-)

+ 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. COUNTIFS with Multiple Criteria in One Range
    By mphillips in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-19-2013, 02:43 PM
  2. Countifs, from multiple columns, within range of years
    By xenomorph8472 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-14-2012, 01:15 PM
  3. Countifs with multiple criteria in a single range
    By Wolfpackfan320 in forum Excel General
    Replies: 1
    Last Post: 02-27-2012, 04:54 PM
  4. How to make faster. Using Worksheetfunction.Countifs
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 07-14-2011, 05:51 AM
  5. multiple 'if-thens' (Chain Rule) with two sheets
    By abuchan in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-06-2010, 05:46 PM

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