Countif-function with asterisk in criteria

  • Thread starter Thread starter Joris Adriaenssens
  • Start date Start date
J

Joris Adriaenssens

I have a list with (alfanumerical) codes in column A. Each code can
occur more than once.

In cel C1 I have one of these codes. In cel D1 I would like to have
the number of occurences of the code in cel C1.

I do this with the formula
=COUNTIF(A:A, C1)

Unfortunately, the code in cel C1 can be something like '*****'
(without the quotes) which is a valid code. When the list of codes
was adopted, nobody thought of the asterisk being a joker-character.

When I put '*****' in cel C1, the formula gives the count of all the
codes in column A, not just the count of the code '*****'.

What can I do to obtain the count of the code '*****' ?

Joris Adriaenssens
Suppose the long list of codes in column A
 
That would count both ***** and *anytextatall (leading asterisk).

So like most things, it depends on what's in the data.
 

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

Back
Top