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
Check out the Formula Handbook template!