D
DartGuru
I have a column of text strings. The strings may contain "Before",
"Before Before", "Before After", "After", "After After" and any
possible mis-spelling of the above and of course blanks.
I want to count the number of cells that contain the word "Before" and
do not contain the word "After".
I tried to be clever with COUNTIF as follows:-
=COUNTIF(COUNTIF(A:A,"*Before*"),"<>*After*")
and I've tried:-
=COUNTIF(A:A,AND("*Before*",NOT("*After*")))
The first one wouldn't compute as a formula, the latter just returned
zero (even though I knew the answer was 2).
I know I could calculate a separate column with 0 or 1 using FIND and
SEARCH, but I was trying to avoid using a separate column.
Any suggestions gratefully received.
"Before Before", "Before After", "After", "After After" and any
possible mis-spelling of the above and of course blanks.
I want to count the number of cells that contain the word "Before" and
do not contain the word "After".
I tried to be clever with COUNTIF as follows:-
=COUNTIF(COUNTIF(A:A,"*Before*"),"<>*After*")
and I've tried:-
=COUNTIF(A:A,AND("*Before*",NOT("*After*")))
The first one wouldn't compute as a formula, the latter just returned
zero (even though I knew the answer was 2).
I know I could calculate a separate column with 0 or 1 using FIND and
SEARCH, but I was trying to avoid using a separate column.
Any suggestions gratefully received.