Count all rows in column A containing “(CLOSED)” or “(DO NOT USE)”

烈酒焚心 提交于 2019-12-04 02:15:24

问题


I am trying to return by Excel function a count of all the rows in column A where the text (CLOSED) or (DO NOT USE) is contained. All rows will contain other values too like so:

Row 1 = Nice Day (CLOSED)
Row 2 = Hello (CLOSED)
Row 3 = Cats & DOGS (CLOSED)
Row 4 = Cats (DO NOT USE)

so I need to search for the keywords (closed) or (do not use) in amongst the text.

Here's what I've tried to do so far but it doesn't work:

=COUNTIF(Sheet2!A2:A3187,"(CLOSED)")

Please can someone point me into the right direction?


回答1:


Please try:

=COUNTIF(A:A,"*(CLOSED)*")+COUNTIF(A:A,"*(DO NOT USE)*")



回答2:


You need to place a wild card in your expression.
If you want to match (CLOSED) anywhere in the string:

=COUNTIF(A:A,"*(CLOSED)*")

If you only want to match it at the end:

=COUNTIF(A:A,"*(CLOSED)")


来源:https://stackoverflow.com/questions/28746408/count-all-rows-in-column-a-containing-closed-or-do-not-use

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!