Countif/Left

  • Thread starter Thread starter JimS
  • Start date Start date
J

JimS

I have a column of data comprised of letters and numbers. I would
like to count the cells that start with M. Also, does it matter if
the text in the cell is centered or not? If it is centered and that
matters then it would not be at the left most of the cell.

Any help appreciated.
 
If the data was centered using the <space bar>, try this:

=SUMPRODUCT(--(LEFT(TRIM(A1:A25))="m"))

If it was centered by formatting, try this:

=Countif(A1:A25,"m*")
 
Hi,

And if you need the count to be case sensitive:

=SUMPRODUCT(--EXACT(LEFT(D4:D7),"M"))

or where centering is caused by spacebar, (quite unusual, that)

=SUMPRODUCT(--(EXACT(LEFT(TRIM(D4:D7)),"M")))
 

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


Back
Top