✔ 最佳答案
You can use the subtotal function 3. It go well with sorting or autofilter
Returns a subtotal in a list or database. It is generally easier to create a list with subtotals using the Subtotals command (Data menu). Once the subtotal list is created, you can modify it by editing the SUBTOTAL function.
Syntax
SUBTOTAL(function_num, ref1, ref2, ...)
Function_num is the number 1 to 11 (includes hidden values) or 101 to 111 (ignores hidden values) that specifies which function to use in calculating subtotals within a list.
Function_num (includes hidden values)
Function_num (ignores hidden values)
Function
1
101
AVERAGE
2
102
COUNT
3
103
COUNTA
4
104
MAX
5
105
MIN
6
106
PRODUCT
7
107
STDEV
8
108
STDEVP
9
109
SUM
10
110
VAR
11
111
VARP