View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rick Rothstein \(MVP - VB\) Rick Rothstein \(MVP - VB\) is offline
external usenet poster
 
Posts: 2,202
Default excel: count uppercase letters in a cell

excel: how to count uppercase letters in a cell

Not the shortest formula of the bunch... just another method to accomplish
the task.

=SUMPRODUCT((CODE(MID(A1,ROW(INDIRECT("A1:A"&LEN(A 1))),1))65)*(CODE(MID(A1,ROW(INDIRECT("A1:A"&LEN( A1))),1))<91))


The 65 in the above formula should have been 64.

=SUMPRODUCT((CODE(MID(A1,ROW(INDIRECT("A1:A"&LEN(A 1))),1))64)*(CODE(MID(A1,ROW(INDIRECT("A1:A"&LEN( A1))),1))<91))

However, we can make this a lot shorter...

=SUMPRODUCT(1*(ABS(77.5-CODE(MID(A1,ROW(INDIRECT("A1:A"&LEN(A1))),1)))<13) )

Still not the shortest though (within 9 characters of it).

Rick