First Lower Case

  • Thread starter George W. Barrowcliff
  • Start date
G

George W. Barrowcliff

I need to select from a text string starting at the first (if any) lower
case character.

MysteryFunction(ABCDeFgh)=5

Any suggestions?

TIA
 
N

N Harkawat

Assuming that your text is on cell A1 then this formula will give you the
position of the a lower case alphabet

=MATCH(1,(--(CODE(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1))>96)),0)

Array entered (ctrl+shift+enter)
 
H

Harlan Grove

N Harkawat wrote...
Assuming that your text is on cell A1 then this formula will give you the
position of the a lower case alphabet

=MATCH(1,(--(CODE(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1))>96)),0)

Array entered (ctrl+shift+enter)
....

This makes the STRONG assumption that A1 would never include any
characters with decimal ASCII codes > 122.

If you define the name LCC referring to "abcdefghijklmnopqrstuvwxyz",
you could use the array formula

=MIN(FIND(MID(LCC,ROW(INDIRECT("1:"&LEN(LCC))),1),A1&LCC))

Or, if you define the name LCA referring to

=MID(LCC,ROW(INDIRECT("1:"&LEN(LCC))),1)

you could use the array formula

=MIN(FIND(LCA,A1&LCA))

This has the flexibility of accomodating other languages with more (or
fewer, e.g., Hawaiian) letters in their alphabets.
 
Top