SPLITBYCASETRANSITION

=SPLITBYCASETRANSITION(text)

text
text to be split by case transition from lower case to upper case

SPLITBYCASETRANSITION will split text by case transition from lower case to upper case

lrobbo314

Well-known Member
Joined
Jul 14, 2008
Messages
3,927
Office Version
  1. 365
Platform
  1. Windows
SPLITBYCASETRANSITION will split text by case transition from lower case to upper case.

Excel Formula:
SPLITBYCASE
=LAMBDA(text,
    LET(
        t,text,
        x,REDUCE(t,SLEN(t),
            LAMBDA(s,c,
                IF(AND(ISLOWER(MID(s,c,1)),ISUPPER(MID(s,c+1,1))),
                s&","&c,
                s)
            )
        ),
        ct,TEXTSPLIT(RIGHT(x,LEN(x)-LEN(t)-1),,",")+1,
        r,ct+SEQUENCE(ROWS(ct),,0),
            REDUCE(t,r,LAMBDA(s,c,REPLACE(s,c,0," ")))
    )
)

SPLITBYCASETRANSITION
A
1TheQuickBrownFoxJumpsOverTheLazyDog
2
3The Quick Brown Fox Jumps Over The Lazy Dog
Sheet1
Cell Formulas
RangeFormula
A3A3=SPLITCASETRANSITION(A1)
 
Upvote 0
1679719098351.png
 
Forgot helpers again.

ISLOWER
Excel Formula:
=LAMBDA(char,LET(c,CODE(char),AND(c>96,c<123)))

ISUPPER
Excel Formula:
=LAMBDA(char,LET(c,CODE(char),AND(c>64,c<91)))

SLEN
Excel Formula:
=LAMBDA(text,SEQUENCE(LEN(text)))
 
Hi again, with your permission, this is also a good example for algorithm awareness, this time, how to analyze diffrent algorithms complexities. ( Big O notation) .Lower is always better and faster.
For a single element, your function uses 2 REDUCE, therefore, for an entire array you will need another LHF (lambda helper function), a MAP.
This means that the Big O will be O(n^3) where n is the nr. of array's elements.
Alternative solution, a function of complexity O(26) , => lot less complex, only 26 iterations, no matter the array size:
UPPSP(a) Upper Space
Excel Formula:
=LAMBDA(a,TRIM(REDUCE(a,CHAR(SEQUENCE(26,,65)),LAMBDA(v,i,SUBSTITUTE(v,i," "&i)))))
Hint: In general, a char "x" is a letter if =EXACT(LOWER(x),UPPER(x)) returns FALSE 😉

Book1.xlsx
ABCDEFG
1calc time instant: for 100k elements
2=IF(SEQUENCE(50000,2),"TheQuickBrownFoxJumpsOverTheLazyDog")=UPPSP(B3#)
3TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
4TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
5TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
6TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
7TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
8TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
9TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
10TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
11TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
12TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
13TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
14TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
15TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
16TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
17TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
18TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
19TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
20TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
21TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
22TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
23TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
24TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
25TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
26TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
27TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
28TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
29TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
30TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
31TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
32TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
33TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
34TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
35TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
36TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
37TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
38TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
39TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
40TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
41TheQuickBrownFoxJumpsOverTheLazyDogTheQuickBrownFoxJumpsOverTheLazyDogThe Quick Brown Fox Jumps Over The Lazy DogThe Quick Brown Fox Jumps Over The Lazy Dog
Sheet2
Cell Formulas
RangeFormula
B2,E2B2=FORMULATEXT(B3)
B3:C50002B3=IF(SEQUENCE(50000,2),"TheQuickBrownFoxJumpsOverTheLazyDog")
E3:F50002E3=UPPSP(B3#)
Dynamic array formulas.
 

Forum statistics

Threads
1,215,575
Messages
6,125,628
Members
449,241
Latest member
NoniJ

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top