计算两对列匹配的次数(Excel 2010)

时间:2014-07-15 14:26:30

标签: excel

我有一个五列电子表格(A-E),其中包含以下信息:

       User  | Report   |  COUNT   |   User  | Report
       A     |    1     |          |    A    |    1 
       B     |    2     |          |    A    |    1
       B     |    3     |          |    A    |    2
       B     |    4     |          |    B    |    1
       C     |    2     |          |    B    |    3
       C     |    5     |          |    C    |    24
       D     |    56    |          |    D    |    56



There are ~650 rows for Columns A and B
There are ~12,000 rows for Columns D and E

对于A栏和B栏,每个用户都有一份独特的报告。

在D栏和E栏中,它为每个用户提供每个报告。

目标是将上面的计数结果输入到此表中:

        User | Report   | Rpt.Loc  |   Count  |   Dept. 
       A     |    1     |    aaa   |          |     
       A     |    2     |    bbb   |          |    
       B     |    1     |    ccc   |          |    
       B     |    3     |    ddd   |          |    
       C     |    2     |    bbb   |          |    
       C     |    5     |    eee   |          |    
       D     |    1     |    aaa   |          |    

    User A has ran Report "1" X amount of times, where X will go into Cell D1.
    User A has ran Report "2" Y amount of times, where Y will go into Cell D2.
    User A has ran Report "3" Z amount of times, where Z will go into Cell D3.

1 个答案:

答案 0 :(得分:1)

如果我正确地理解了你的问题 - 你想要的每一行都要计算你在A和A列中所拥有的任何数量的次数。该行的B 出现在D&列中。整个工作表中的E,您将放在单元格C1中的公式为:

=COUNTIFS($D$1:$D$1000,A1,$E$1:$E$1000,B1)

然后将其复制到整个列中(当然,将最终行号从$1000更改为正确的行号)。

基本上,您是这样说的:计算D列在此行中具有值的次数&#39; s列和列E具有此行中的值&lt; s B列< / em>的

希望能回答你的问题并做到这一点!!