+ Reply to Thread
Results 1 to 7 of 7

Countif +CountIF Alternative

  1. #1
    Registered User
    Join Date
    11-16-2016
    Location
    California
    MS-Off Ver
    2010
    Posts
    8

    Question Countif +CountIF Alternative

    I have the following Count if Function to add up the two different variations in ColC
    =COUNTIFS(C:C,"<>Gabriel Wong",D:D,"Gabriel Wong",E:E,"<>Gabriel Wong",P:P,T2)+COUNTIFS(C:C,"<>Carson Love",D:D,"Carson Love",E:E,"<>Carson Love",P:P,T2)

    I have tried
    =Sum(COUNTIFS(C:C,"<>"&{"Carson Love","Gabriel Wong"},D:D,{"Carson Love","Gabriel Wong"},E:E,"<>"{"Carson Love","Gabriel Wong"}",P:P,T3))

    And dabbled a bit into Sum Product.

    Any way to shorten the Countif + Countif Functions. I add 17 more names and I would rather not have that many countif functions.

    I am also constrained to use Google SHeets

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Countif +CountIF Alternative

    I am not familiar with Google Sheets. This works in desktop Excel.

    Put all the names in a lookup column.

    Then create a dynamic named range in Name Manager. They shrink or grow as you remove or add data.

    If you are not familiar with how to build these:

    With the list of names in column M starting at M1 type this formula is some out of the way place and copy it from the formula bar.

    =$M$1:INDEX(M:M,MATCH("zzzz",M:M,1)

    In Name Manager click "New".
    In the Name text box give your formula a name ... NameList might be one.
    Then in "Refers to:" paste the formula.
    Hit OK.

    Then replace the array constants in your formula with NameList. As you add names to the list in column M they will automatically be included in NameList.
    Last edited by FlameRetired; 11-17-2016 at 12:03 AM.
    Dave

  3. #3
    Registered User
    Join Date
    11-16-2016
    Location
    California
    MS-Off Ver
    2010
    Posts
    8

    Re: Countif +CountIF Alternative

    If I am doing this correctly, I have a Name Manger tab under DMA and my formula is now
    =ArrayFormula(SUM(COUNTIFS(C:C,"<>"&DMA!A:A,D:D,DMA!A:A,E:E,"<>"&DMA!A:A,P:P,R4)))
    I don't get the same answer as when I did the additive countif functions. I tested it out with a simple =ArrayFormula(SUM(COUNTIFS(C:C,DMA!A:A))) and that worked but not sure what I and doing wrong with the Array formula now.

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Countif +CountIF Alternative

    You can't do the Sum(countifs(.... {criteria1,criteria2})) syntax with <> type of criteria.
    Well, you CAN. But it's not doing what you think it is.

    That syntax works like an OR, and only works with DOES EQUAL criteria.
    Because it's an OR.

    So your attempt is saying count if C <> Carson Love OR C <> Gabriel Wong.
    No matter what value is in C, that will ALWAYS be TRUE.
    if C happens to be Carson Love, then <> Gabriel Wong is TRUE, So the OR is TRUE, and it's counted
    If C happens to be Gabriel Wong, then <> Carson Love is TRUE, So the OR is TRUE, and it's counted

  5. #5
    Registered User
    Join Date
    11-16-2016
    Location
    California
    MS-Off Ver
    2010
    Posts
    8

    Re: Countif +CountIF Alternative

    What can I do to get around this?

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Countif +CountIF Alternative

    I see nothing wrong with your attempt at abbreviation, which can also be more efficiently written:

    =SUMPRODUCT(COUNTIFS(C:C,"<>"&G1:G2,D:D,G1:G2,E:E,"<>"&G1:G2,P:P,T2))

    with your names in G1:G2 (and which can of course be extended).

    Regards
    Last edited by XOR LX; 11-18-2016 at 05:19 AM.
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  7. #7
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Countif +CountIF Alternative

    Quote Originally Posted by GabeGabe View Post
    What can I do to get around this?
    Difficult to say, I'm not even sure I understand what the formula is supposed to do.

    Can you explain in words what you want the formula to do?

+ 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. Solver not working with countIf / Alternative solution needed
    By ek3040 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-09-2015, 05:28 PM
  2. Alternative Method for Countif, without Looping
    By cmore in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 11-03-2013, 04:50 PM
  3. Countif or countifs alternative for exel 2003?
    By sai19 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-28-2013, 08:56 AM
  4. Is there any alternative to multiple COUNTIF? Over 64 nested limitation.
    By Corsajon in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 03-08-2013, 01:46 PM
  5. Alternative for a CountIF which using a Helper Column?
    By e4excel in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-11-2012, 03:25 AM
  6. Alternative to COUNTIF with Variable Range
    By fervorking in forum Excel General
    Replies: 2
    Last Post: 07-21-2011, 05:03 PM
  7. COUNTIF Alternative for multiple criteria?
    By Dan17602 in forum Excel General
    Replies: 6
    Last Post: 03-21-2011, 12:49 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