我有一个工作日表,我想计算每行中单词“work”的实例数。 我有一个这样的表:
我在 J1 单元中使用了此代码,但它不起作用。
=SUM(IF(2:2 = "Sleep",1,0))
我在微软的网站上找到了这个公式,但它不起作用。 是什么导致了这个问题?
最佳答案
您需要使用COUNTIF
函数。
=COUNTIF(C2:I2,"Sleep")
这位于单元J2
来自 Excel 的帮助
The COUNTIF function counts the number of cells within a range that meet a single criterion that you specify. For example, you can count all the cells that start with a certain letter, or you can count all the cells that contain a number that is larger or smaller than a number you specify.
如有疑问,请按 Excel 中的魔术按钮 F1
。 :)
关于excel - 如何计算Excel中文本实例的数量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16129542/