2015-03-03 57 views
0

我正在計算Excel工作表上每行的條目數。該公式應計算包括當前行和上面的條目數,但應分別計算每個值。像這樣:香蕉出現四次;因此它將在A1上打印1,在A3上打印2,在A4上打印3,在A8上打印4。
任何幫助將不勝感激。在Excel中計算多個行條目

 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) 

非常感謝!

回答

0

獨自走,危險!

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

將此公式輸入到B1並拖放。

0

類型的列式C你會得到你期待什麼

enter image description here

+0

非常感謝你的回覆!我太過複雜了! :) – user3888272 2015-03-03 16:28:22