Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 249
Default search for capital letter at end of text string

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default search for capital letter at end of text string

If the last character is always a letter:
=IF(EXACT(UPPER(RIGHT(D18,1)),RIGHT(D18,1)),"Upper ","NotUpper")

But this will return Upper for numbers, punctionation, special characters, ...

=IF(AND(CODE(RIGHT(D18,1))=CODE("A"),CODE(RIGHT(D 18,1))<=CODE("Z")),
"upper","not upper")

Checks for A to Z.


Roger on Excel wrote:

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


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default search for capital letter at end of text string

Check your other post.

Roger on Excel wrote:

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


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 249
Default search for capital letter at end of text string

Thanks - that is exactly what i was looking for

regards,

Roger

"Rick Rothstein (MVP - VB)" wrote:

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





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 249
Default search for capital letter at end of text string

Thanks for the help,

Best regards,

Roger

"Dave Peterson" wrote:

If the last character is always a letter:
=IF(EXACT(UPPER(RIGHT(D18,1)),RIGHT(D18,1)),"Upper ","NotUpper")

But this will return Upper for numbers, punctionation, special characters, ...

=IF(AND(CODE(RIGHT(D18,1))=CODE("A"),CODE(RIGHT(D 18,1))<=CODE("Z")),
"upper","not upper")

Checks for A to Z.


Roger on Excel wrote:

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


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
search for words with capital letter at end Roger on Excel Excel Discussion (Misc queries) 7 July 22nd 08 07:19 PM
I did not obtain to transform text of small letter for capital le Claudio Excel Discussion (Misc queries) 1 July 24th 07 12:25 PM
New Validation option to format 1st letter as Capital letter Jeff Excel Discussion (Misc queries) 5 July 13th 06 05:11 AM
search a string and strip out ONLY the capital letters aph Excel Programming 3 September 27th 05 11:35 AM
how do I convert text in excel to 1st letter capital,only jmfp Excel Worksheet Functions 1 June 16th 05 08:11 PM


All times are GMT +1. The time now is 06:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"