correct use of COUNTIF function?

  • Thread starter Thread starter Doc H
  • Start date Start date
D

Doc H

Hi
I work in education and often need to count letter coded GCSE grades to
work out percentages of A to C, A to G and that sort of thing.

Currently I use a bunch of countif statements such as

= COUNTIF(A1:A578,"A")
= COUNTIF(A1:A578,"B")
= COUNTIF(A1:A578,"C")
etc and then do the maths afterwards.
However the exam boards in their wisdom invented a higher grade than A
called A star. My data comes in with either a code of A* or just the *

Since * is a wild card I get the wrong answer using = COUNTIF(A1:A578,"A*")

Qn. How do I count how many times A* occurs (or how many times * occurs) ?

PS if anyone can answer the same question for searching via queries in MS
Access then I'd be grateful

Howard
 
Hi Howard

A prefix tilde (~) means "exactly this character", so
=COUNTIF(A1:A10,"A~*")

This also goes for other Excel functions and options. Menu Edit > Find, find ~* will find
the first "star".
 
For A*:
=COUNTIF(A1:A578,"A~*")

For just *:
=COUNTIF(A1:A578,"~*")

HTH
Jason
Atlanta, GA
 
Back
Top