COUNTIF problem

  • Thread starter Thread starter mwam423
  • Start date Start date
M

mwam423

greetings, i'm using COUNTIF formula to count responses from a survey and am
having problem as the formula can't distinguish between "N" and "N*"

however, another part of database includes responses "Highest" and
"Highest*" and COUNTIF seemingly can tell the difference here. any ideas?
 
The * is a wildcard character. N* means N followed by anything. Is that how
you want it to work or are you wanting to count the literal string N* ?

To count the literal string N* :

=COUNTI(A1:A100,"N~*")

The tilde character is a wildcard "escape" character.
 
hi biff, didn't even notice the typo as we probably won't be tweaking
formula for solution (but N~* to identify literal "N*" is great stuff and,
i'm sure, will come in handy. got the gist of the problem once i read your
reply and since our process is pretty formalized, we can ensure, for
instance, that a space precedes any asterisk. COUNTIF easily recognizes that
difference, thanks for the expertise!
 
hi biff, hoping this reply gets to you. i've got another problem with
COUNTIF, seems to have hard time seeing difference between text like, >=BBB
and >=AA, or >=AA 3% and >AA10%, or <BBB and 15%; Non-USD: P. do the < or >
signs have any significance?
 
Try it like this:

=COUNTIF(A1:A10,"=>=BBB")

Notice the additional = sign.

That might be a little cryptic and induce confusion. Here's another way:

=SUMPRODUCT(--(A1:A10=">=BBB"))

That's "slightly" more intuitive!
 
hi biff, thanks for the reply! fyi, for COUNTIF, and later SUMPRODUCT, i
was using cell reference rather than something explicit, in quotes, for the
criteria and i'm thinking that's part of the problem.

hope this makes some sense: in the range (a1:a10) i have a menu generated
list which may have zero, one, or multiple entries. the criteria is each
cell in a 50+ column X 200+ row grid and i just wanted a 1 to result if a
cell in the gird matches any of the choices macro user selected from a menu.
the value 1 is more like a marker that helps macro figure which columns and
rows to print (utilizing autofilter).

as a result i'm using IF(ISNA(MATCH(a1:a10, mycell, 0)),0,1) because MATCH
seems to work well with labels, which is what all the data is/will be
formatted in.
 
Oh, I get it! Sometimes I'm pretty dense!

When using a cell to hold the criteria:

AA1 = 10

=COUNTIF(A1:A10,">="&AA1) = greater than or equal to AA1
=COUNTIF(A1:A10,">"&AA1) = greater than AA1
=COUNTIF(A1:A10,AA1) = equals AA1
=COUNTIF(A1:A10,"<>"&AA1) = is not equal to AA1
=COUNTIF(A1:A10,"<="&AA1) = less than or equal to AA1
=COUNTIF(A1:A10,"<"&AA1) = less than AA1
 
hi biff, i've sent you copy of the model, and forgot to include that to
prompt macro hit [ctrl-a]
 
hi biff, sent file to your biffinpitt address but got bounced. if you want
to contact me i can be reached at below address

(e-mail address removed)
Replace mailinator with mwamllc
 
Well, I don't accept files unless I've *invited* someone to send it.

If I invite someone to send a file I'll reject it for security reasons if it
contains any VBA code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Excel Need Countifs Formula Help 0
Countif Based on Date Range 3
COUNTIF between dates and if value = "y" 8
COUNTIF Cells in Range? 4
Excel Use COUNTIF across a range of cells with formulas 0
Countif Problem 3
Conditional Formatting 2
Countif 1

Back
Top