How to count “No” in column C base on Name & Id?

前端 未结 3 772
Happy的楠姐
Happy的楠姐 2021-01-25 05:07

I have 3 columns.

-----A-----B-----C-----
---Name----ID---Report

In column A I have Names(Can Repeat)
In column B I have IDs (can repeat wi

相关标签:
3条回答
  • 2021-01-25 05:28

    This seems to be very close to what you are trying to do

    =SUMPRODUCT((A2:A1000="John")*(C2:C1000="No")*(IF(FREQUENCY(B2:B1000,B2:B999)>0,TRUE)))
    

    There is one flaw with the frequency in that it ignores the last row. If I change the frequency formula to FREQUENCY(B2:B1000,B2:B1000) it will error out as it returns 10 results instead of the desired 9.

    EDIT

    It is probably better to extend the other ranges than shorten the bins array.

    =SUMPRODUCT((A2:A1001="John")*(C2:C1001="No")*(IF(FREQUENCY(B2:B1001,B2:B1000)>0,TRUE)))
    
    0 讨论(0)
  • 2021-01-25 05:43

    You can use a single formula like this:

    =SUM(IF(FREQUENCY(IF(A2:A200="John",IF(C2:C200="No",B2:B200)),B2:B200),1))

    That's an "array formula that needs to be confirmed with CTRL+SHIFT+ENTER

    That gives 3 for your example - note that it requires column B data to be numeric which seems to be the case here.....

    0 讨论(0)
  • 2021-01-25 05:51

    My thought is to add column D with the formula =COUNTIFS(A:A,"="&A2,B:B,"="&B2,C:C,"="&C2). This will give you the number of duplicates for each line. If a line returns a 3, then it means there are two other instances of that exact configuration.

    Next, create a new table, for testing I did this in columns G and H. Column G is just numbered 1,2,3 etc. beginning in G2. The Name is a header and reference in cell H1, in this case John. Then put this formula in cell H2: =COUNTIFS(A:A,"="&$H$1,C:C,"=No",D:D,"="&G2)/G2 and drag it down. It is essentially counting the instances of each "1" duplicate, "2" duplicate, and "3" duplicate (which might actually be useful). Then just sum the H column and you should have your answer.

    0 讨论(0)
提交回复
热议问题