Count cells that do not contain specific text and are not blank
Hello,
I am trying to count all cells that do not contain the text "gap" and cells that are not blank but I'm having trouble. Below are the two formulas I've tried.
=COUNTIF({Range}, NOT(HAS(@cell, "Gap")AND(@cell, <>""))) -> Error: #UNPARSEABLE
=COUNTIF({Range}, NOT(HAS(@cell, "Gap"), NOT(HAS(@cell, <>"")))) -> Error: #INCORRECT ARGUMENT
Any help would be appreciated
Best Answer
-
Hello @Taylor S! Please try this formula:
=COUNTIFS({Range}, NOT(CONTAINS("gap", @cell)), {Range}, <>"")
Answers
-
Will this range include cells that include "gap" in a sentence or a list, or will the cells be "gap" exactly?
If you want to exactly match "gap":
=COUNTIFS({Range}, AND(NOT(HAS(@cell, "Gap")), @cell <> ""))
If you want to include cells that have "gap" somewhere within the cell:
=COUNTIFS({Range}, AND(NOT(CONTAINS("Gap", @cell)), @cell <> ""))
-
Hello @Taylor S! Please try this formula:
=COUNTIFS({Range}, NOT(CONTAINS("gap", @cell)), {Range}, <>"")
-
That worked. thanks!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.8K Get Help
- 437 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 65 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!