Counting letter ranges

C

Carter

Greetings,

I have a list of company names that I need to tally a number for based on
the first two letters of the name over a range. For instance how many
companies begin with the letters "HI-MF". I have used the formula
=COUNTIF(A:A,"HI*") to get the first part but I do not know how to expand
this formula over a range of letters.

Any assistance would be very much appreciated... Best Regards,
 
B

Bob Phillips

Try this

=SUMPRODUCT(--(LEFT(A2:A20,2)>="HI"),--(LEFT(A2:A20,2)<="MF"))

HTH

Bob
 
R

Ron Rosenfeld

Try this

=SUMPRODUCT(--(LEFT(A2:A20,2)>="HI"),--(LEFT(A2:A20,2)<="MF"))

HTH

Bob

Modification to eliminate counting entries like:

A2: M

=SUMPRODUCT(--(LEFT(rng,2)>="HI"),--(LEFT(rng,2)<="MF"),--(LEN(rng)>=2))

--ron
 
B

Bob Phillips

Good point!

Bob

Ron Rosenfeld said:
Modification to eliminate counting entries like:

A2: M

=SUMPRODUCT(--(LEFT(rng,2)>="HI"),--(LEFT(rng,2)<="MF"),--(LEN(rng)>=2))

--ron
 

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

Top