Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 16
Default Testing the case of text in a cell

Can anyone suggest a simple way, using formulas, to test whether the text in a cell is all lowercase? I have found one way to do this but it's very complicated and I think there must surely be an easier way.

My first thought was to use the LOWER function (converts text to lowercase) in the formula =(LOWER(A1) = A1) . But this doesn't work, as text comparison seems to be case-insensitive so this always gives TRUE. I didn't want to create a custom function and eventually came up with the ridiculously complex array formula
{=MIN(IFERROR(CODE(MID(A1, {1,2,3,4,5,6,7,8,9,10,11,12,13},1)), 500))=97}
which tests each letter (assuming there are at most 13 letters, which there are in my case) using its ASCII code. (The IFERROR handles cases where there are fewer than 13 letters.) This works if the text consists only of letters.

But can anyone suggest a simpler way?

Howard
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 829
Default Testing the case of text in a cell

"Howard Silcock" wrote:
Can anyone suggest a simple way, using formulas,
to test whether the text in a cell is all lowercase?


=IF(EXACT(A1,LOWER(A1)),"all lowercase","not all lowercase")

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 16
Default Testing the case of text in a cell

On Thursday, April 3, 2014 10:05:24 AM UTC+11, joeu2004 wrote:
"Howard Silcock" wrote:

Can anyone suggest a simple way, using formulas,


to test whether the text in a cell is all lowercase?




=IF(EXACT(A1,LOWER(A1)),"all lowercase","not all lowercase")


Thank you very much. I thought there must be a built-in function I could use.

Howard
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
Changing multiple cell text from lower case to upper case Patti Excel Discussion (Misc queries) 2 January 4th 08 08:35 PM
Newbie: Problem with 'Select Case' testing syntax Thomas Toth Excel Programming 9 September 11th 07 04:34 PM
Change the text from lower case to upper case in an Excel work boo dave01968 Excel Discussion (Misc queries) 2 December 9th 05 09:09 AM
Detecting Case of Text in a Cell Colin Vicary Excel Discussion (Misc queries) 2 October 19th 05 04:30 PM
How do I change existing text from lower case to upper case CT Cameron Excel Discussion (Misc queries) 2 November 30th 04 01:07 AM


All times are GMT +1. The time now is 03:05 AM.

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"