计算excel中的多个行条目

时间:2015-03-03 12:53:04

标签: excel count conditional-statements

我正在尝试计算Excel工作表上每行的条目数。公式应计算包括当前行和高于当前行的条目数,但应单独计算每个值。像这样:香蕉出现四次;因此,它将在A1上打印1,在A3上打印2,在A4打印3,在A8打印4 任何帮助将不胜感激。

        A           B (expected result)
1   Banana          1   (Count all the entries "Banana" from A1:A1)
2   Apple           1   (Count all the entries "Apple" from A1:A2)
3   Banana          2   (Count all the entries "Banana" from A1:A3)
4   Banana          3   (Count all the entries "Banana" from A1:A4)
5   Apple           2   (Count all the entries "Apple" from A1:A5)
6   Apple           3   (Count all the entries "Apple" from A1:A6)
7   Cherry          1   (Count all the entries "Cherry" from A1:A7)
8   Banana          4   (Count all the entries "Banana" from A1:A8)

非常感谢!

2 个答案:

答案 0 :(得分:0)

独自一人去拿这个很危险!

=COUNTIF($A$1:$A1,$A1)

将此公式输入B1并将其拖放。

答案 1 :(得分:0)

在C列中键入公式您将得到您期望的结果

enter image description here