Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Mar 2006
    Location
    Princeton, New Jersey, USA
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.
    Legare Coleman

  3. #3
    Star Lounger
    Join Date
    Mar 2006
    Location
    Princeton, New Jersey, USA
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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. #4
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.
    Legare Coleman

  5. #5
    Star Lounger
    Join Date
    Mar 2006
    Location
    Princeton, New Jersey, USA
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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
  •