View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.misc
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default Counting Characters in cells

On Tue, 23 Jun 2009 08:42:02 -0700, Brian Bermingham
wrote:



"Ron Rosenfeld" wrote:

On Tue, 23 Jun 2009 08:11:01 -0700, Brian Bermingham <Brian
wrote:

Hi

I want to count the number of cells containing a particular uppercase
character.
I tried using =COUNTIF(J2:AN2,"H") but this counts lowercase as well.
Is there any way to count upper case or lower case only?

I am using Excel 2007

Thanks
Brian



Try:

=SUMPRODUCT(--ISNUMBER(FIND("H",J2:AN2)))

--ron


Thanks ron that woks fine.
Just so I understand, the character is being compared as a number and as
upper case and lower case have diffeten values only the specified version is
counted?

Thanks

Brian


Yes, only the Upper case is being counted.

FIND is a case-sensitive function. (If you want a case-insensitive variant,
use SEARCH instead).

If FIND locates a match, it returns a number, if it does NOT find a match, it
returns an #VALUE! error.

ISNUMBER converts the VALUE errors to FALSE; and the numeric returns to TRUE.

The double unary (--...) converts the TRUEs and FALSEs to 1's and 0's.

The SUMPRODUCT adds up all the 1's to give you the number of cells in which "H"
was matched.
--ron