search for words with capital letter at end

  • Thread starter Thread starter Roger on Excel
  • Start date Start date
R

Roger on Excel

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
 
hi
excel usually doesn't distinguish between upper and lower case so you have
to be specific about the character.
=if(right(D18,1) = CHAR(77), "Yes","no")

in ASCII, the uppercase M is character 77, the lower case m is character 109.
for future reference....
=char(77) and =char(109)
to see all...
in A1 enter =char(row())
copy down to row 256.
some of the characters are "non-printable" characters like space, tab,
backspace so you will only se a small square. some are hold overs from old
teletype days(the origin of ASCII) like begin text, end text, end
transmittion, devise control 2(whatever that is).

regards
FSt1
 
You can use the "FIND" function which differentiates between upper and
lowercase (similar to SEARCH" function)
 
=IF(ISERROR(FIND("R",RIGHT(E6,1),1)),"no","yes")

Manic said:
You can use the "FIND" function which differentiates between upper and
lowercase (similar to SEARCH" function)
 
=IF(ISERROR(FIND("R",RIGHT(E6,1),1)),"no","yes")

A few keystrokes shorter:

=IF(COUNT(FIND("R",RIGHT(E6))),"yes","no")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top