通过给出起点和终点来计数发生

时间:2018-08-04 02:25:09

标签: excel excel-formula excel-2010

让我们说A1:AF1仅包含a,b或c(三个字母之一)。通过给出起点和终点,我如何计算给定范围内a,b和c的出现?例如,如果我给出1和5,我想计算A1到E1中a,b和c的出现。如果我给出10和25,我想计算J1到Y1中的出现次数。首选基于公式的解决方案。

1 个答案:

答案 0 :(得分:1)

在A3中为10,在A4中为25,您可以在J1:Y1中使用

a,b 和 c 来计数

'count a, b and c
=sum(countif(index(1:1, , a3):index(1:1, , c1), {"a", "b", "c"}))
'count a
=countif(index(1:1, , a3):index(1:1, , a4), "a")
'count b
=countif(index(1:1, , a3):index(1:1, , a4), "b")
'count c
=countif(index(1:1, , a3):index(1:1, , a4), "c")