[英]How to count the number of rows which contain a cell containing specific text?
I am super new to Stack Overflow so if I do anything wrong, let me know.我是 Stack Overflow 的超级新手,所以如果我做错了什么,请告诉我。
Essentially, I am trying to create a formula which will look at a row and check if any of its cells contain specific text and, if so, count the number of rows which do.本质上,我正在尝试创建一个公式,该公式将查看一行并检查其任何单元格是否包含特定文本,如果是,则计算包含的行数。 The issue I am having is that I am checking the cells not for if they equal the exact text, just if they contain it.
我遇到的问题是我正在检查单元格,而不是检查它们是否等于确切的文本,只是它们是否包含它。
If any additional information or context is needed, which I am sure it is, please just let me know what you need.如果需要任何其他信息或上下文,我相信它是,请让我知道您需要什么。
if you are looking for any value and not any specific value then You can use CountA formula in this case as COUNTA simply counts the number of cells that contain any value (that is, cells that are not blank) but If you are looking for a specific text in a row then you can use COUNTIF formula.如果您正在寻找任何值而不是任何特定值,那么您可以在这种情况下使用 CountA 公式,因为 COUNTA 只是计算包含任何值的单元格的数量(即非空白的单元格),但如果您正在寻找一行中的特定文本,然后您可以使用 COUNTIF 公式。
If for example the data in a row in is A1:H1
, you could use OR(NOT(ISERROR(FIND,<search text>,A1:H1))))
.例如,如果一行中的数据是
A1:H1
,则可以使用OR(NOT(ISERROR(FIND,<search text>,A1:H1))))
。 FIND
is case-sensitive. FIND
区分大小写。 In some earlier versions on Excel, you may need to use Ctrl + Shift + Enter .在 Excel 的一些早期版本中,您可能需要使用Ctrl + Shift + Enter 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.