# Thread: Countif and the Right function (Excell 2000 or 2003)

1. ## Countif and the Right function (Excell 2000 or 2003)

Hi All,

I'm not sure why I can't figure this one out, but I can't. Sorry. I need a formula that counts the cells from A26:A50 -- but only if the last character is a "M". Cells A26:A50 look something like this:
G1-01-F
G1-02-M
G1-03-M
G1-04-F

=countif(A26:A50,right(??,1)="M")

Thanks,
--Cindy

But, obviously this formula doesn't work.

2. ## Re: Countif and the Right function (Excell 2000 or 2003)

Try this array formula:

<code>
=SUM((RIGHT(A1:A4,1)="M")*1)
</code>

That is an array formula and you must hold down Ctrl and Shift when you press Enter to confirm it.

3. ## Re: Countif and the Right function (Excell 2000 or 2003)

Thank You! I don't know much about arrays and I really like ability to manipulate text as numbers by the trick of multiplying by 1 !!!

I love this site!
--cat

4. ## Re: Countif and the Right function (Excell 2000 or 2003)

Multiplying by one does not allow manipulating TEXT as numeric values. In this case, the comparison of the text cell value to "M" results in a logical value, not a text value. A logical value is 1 for true and 0 for false. Multilpying the logical value by one forces the conversion of the logical value to a numeric value so that it can be summed.

5. ## Re: Countif and the Right function (Excell 2000 or 2003)

Thank you, Legare, for the clarification.
--cat

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•