+ Reply to Thread
Results 1 to 5 of 5

A better way to COUNTIFS + COUNTIFS + COUNTIFS

  1. #1
    Registered User
    Join Date
    12-04-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    79

    A better way to COUNTIFS + COUNTIFS + COUNTIFS

    Hi,

    I have a lot of formula's that consist of
    =(COUNTIFS,range,criteria1,criteria2,criteria3)+(COUNTIFS,range,criteria1,criteria2,criteria3)+(COUNTIFS(range,criteria1,criteria2,criteria3)

    In all situations criteria 1 and criteria 2 are the same, the reason for the addition between the formula is that criteria 3 changes in each COUNTIFS within the full formula.

    Is there a better way of constructing this formula to strip back the massive number of COUNTIFS that my spreadsheet now has which is slowing it down?

    Thanks so much

    Chris

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

    Re: A better way to COUNTIFS + COUNTIFS + COUNTIFS

    If criteria 3 is a list you can do this

    =SUMPRODUCT(COUNTIFS(range1,crit1,range2,crit2,range3,crit3))
    Audere est facere

  3. #3
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: A better way to COUNTIFS + COUNTIFS + COUNTIFS

    You could do a SUMPRODUCT with OR logic. It would be something like:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    My guess would be that if a single record has say crit3a, crit3b and crit3c all true that you dont want to count them 3x (as would your original formula), only once? The above will count multiple times. Its most useful when the 3 criteria are in the same column and thus 1 record cant be true for more than 1/3.

    If you wanted to adjust it you can do:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Essentially for that record if 1 or more are true return true (1), thus counting 1,2 or 3 as 1

    Hope this helps

  4. #4
    Registered User
    Join Date
    12-04-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    79

    Re: A better way to COUNTIFS + COUNTIFS + COUNTIFS

    Hi,
    I'm not sure if it is a list

    My full formula is:

    =(COUNTIFS(A:A,E1,B:B,F1,C:C,X1) + (COUNTIFS(A:A,E1,B:B,F1,C:C,Y1) + (COUNTIFS(A:A,E1,B:B,F1,C:C,X1))

    It's the 3rd criteria that changes from X to Y and Z in the formula.

    Would SUMPRODUCT be able to handle this?

    Lying behind this is the fact that X1, Y1 and Z1 are all controllable - so I can change what lies in them to then alter the COUNT criteria.

  5. #5
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: A better way to COUNTIFS + COUNTIFS + COUNTIFS

    Yes- as DaddyLongLegs suggested
    =SUMPRODUCT(COUNTIFS(A:A,E1,B:B,F1,C:C,X1:Z1))
    should suffice.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

+ 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] Sumproduct to replace countifs as countifs don't work on external source reference
    By KrishnaSagar in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-02-2017, 02:33 AM
  2. How can I run CountIfs + CountIfs without double counting?
    By hiitsjessie in forum Excel General
    Replies: 1
    Last Post: 02-06-2017, 04:49 PM
  3. [SOLVED] COUNTIFS - not
    By WSRSJT in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-01-2015, 09:19 AM
  4. [SOLVED] Countifs + Countifs - replacement?
    By JulieQ in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-05-2015, 03:02 PM
  5. COUNTIFS OR COUNTIFS needs to work
    By joshbellfi in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-23-2013, 10:55 AM
  6. COUNTIFS OR...multiple countifs without duplication in the numbers
    By HooligaD in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-21-2012, 09:53 AM
  7. Replies: 0
    Last Post: 12-16-2011, 09:01 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