ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   First Lower Case (https://www.excelbanter.com/excel-worksheet-functions/24464-first-lower-case.html)

George W. Barrowcliff

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

MysteryFunction(ABCDeFgh)=5

Any suggestions?

TIA



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)




"George W. Barrowcliff" wrote in message
...
I need to select from a text string starting at the first (if any) lower
case character.

MysteryFunction(ABCDeFgh)=5

Any suggestions?

TIA





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.



All times are GMT +1. The time now is 03:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com