View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\)[_2355_] Rick Rothstein \(MVP - VB\)[_2355_] is offline
external usenet poster
 
Posts: 1
Default search for capital letter at end of text string

Try it this way in order to check for a specific upper cased letter...

=IF(EXACT(RIGHT(D18),"M"),"yes","no")

and this way to see if the letter, no matter which one it is, is upper
case...

=IF(AND(CODE(RIGHT(D18))=65,CODE(RIGHT(D18))<=91) ,"yes","no")

Rick


"Roger on Excel" wrote in message
...
I need to search for a word with a capital letter at the end of the string.

For example

Hydrochloric acid 1M

Ive tried using =IF(RIGHT(D18)="M","yes","no"), but it doesnt
differentiate
between lower case and upper case.

Can anyone help?

Thanks,

Roger