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
- Smartsheet Customer Resources
- 62.3K Get Help
- 364 Global Discussions
- 199 Industry Talk
- 428 Announcements
- 4.4K Ideas & Feature Requests
- 136 Brandfolder
- 127 Just for fun
- 128 Community Job Board
- 444 Show & Tell
- 28 Member Spotlight
- 1 SmartStories
- 283 Events
- 35 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!