Lyle Blosser
New Member
- Joined
- Feb 5, 2010
- Messages
- 3
I have a spreadsheet with a named range ("Names") that contains a list of business names. I want to find out how many businesses have names starting with the letters specified in an interval. For example, I want to answer a question like:
How many businesses have names that start with letters from A-C?
How many businesses have names that start with AM-AT?
etc.
What is the best way to do this? I tried playing around with COUNTIF, but the only way I could come up with an answer was to combine multiple COUNTIF functions. For example, to look for names that start with A-C, I had to write =COUNTIF(Names,"A*")+COUNTIF(Names,"B*")+COUNTIF(Names,"C*"). This is OK for a short range, but gets unwieldy for longer ranges. For example, if I wanted to look for A-M, I would need 13 terms.
I would also like to be able to specify the begining and end of the range in separate cells (ex: A1="AM", B1="AT") and have the formula use those cells.
Any ideas?
How many businesses have names that start with letters from A-C?
How many businesses have names that start with AM-AT?
etc.
What is the best way to do this? I tried playing around with COUNTIF, but the only way I could come up with an answer was to combine multiple COUNTIF functions. For example, to look for names that start with A-C, I had to write =COUNTIF(Names,"A*")+COUNTIF(Names,"B*")+COUNTIF(Names,"C*"). This is OK for a short range, but gets unwieldy for longer ranges. For example, if I wanted to look for A-M, I would need 13 terms.
I would also like to be able to specify the begining and end of the range in separate cells (ex: A1="AM", B1="AT") and have the formula use those cells.
Any ideas?