MID( SUBSTITUTE(Text,Delim,REPT(" ",LEN(Text))) , element*LEN(Text)-(LEN(Text)-1) , LEN(Text) )
Test...
MID( SUBSTITUTE(Text,Delim,REPT(" ",LEN(Text))) , (element*LEN(Text)) - (LEN(Text)-1) , LEN(Text) )
MID( SUBSTITUTE(Text,Delim,REPT(" ",LEN(Text))) , (element*LEN(Text)) - ( LEN(Text) ) , LEN(Text) )
Row\Col |
A |
B |
C |
1 |
|
|
What is pseudo is in the Cell to the left ( column B ) |
2 |
Example get the first thing, 1 from the Text string "1,3,5" |
1,3,5 |
my original test text |
3 |
Length |
5 |
the length in characters of my original test text |
4 |
( Rept " " ) x Length |
|
5 spaces like "12345" |
5 |
Substitute in the original string ( B2 ) 5 spaces for each comma seperator |
1_____3_____5 |
like "1123453123455" is 13 characters |
6 |
I apply to B5 the MID function starting at (1x5)-(5-1)=1 and for a length of 5 |
1____ |
like "11234" |
7 |
I apply to B5 the MID function starting at (1x5)-(5)=0 and for a length of 5 |
#VALUE! |
Excel doesn't forgive me for trying to start at 0 !!!! |
8 |
|
|
|
9 |
Example get the second thing, 3 from the Text string "1,3,5" |
1,3,5 |
my original test text |
10 |
Length |
5 |
the length in characters of my original test text |
11 |
( Rept " " ) x Length |
|
5 spaces like "12345" |
12 |
Substitute in the original string ( B9 ) 5 spaces for each comma seperator |
1_____3_____5 |
like "1123453123455" is 13 characters |
13 |
I apply to B12 the MID function starting at (2x5)-(5-1)=6 and for a length of 5 |
_3___ |
like "13123" |
14 |
I apply to B12 the MID function starting at (2x5)-(5)=5 and for a length of 5 |
__3__ |
like "12312" |
15 |
|
|
|
16 |
Example get the third thing, 5 from the Text string "1,3,5" |
1,3,5 |
my original test text |
17 |
Length |
5 |
the length in characters of my original test text |
18 |
( Rept " " ) x Length |
|
5 spaces like "12345" |
19 |
Substitute in the original string ( B16 ) 5 spaces for each comma seperator |
1_____3_____5 |
like "1123453123455" is 13 characters |
20 |
I apply to B19 the MID function starting at (3x5)-(5-1)=11 and for a length of 5 |
__5 |
like "125" Note: I try to do length 5, but Excel forgives me and gives the 3 it has available |
21 |
I apply to B19 the MID function starting at (1x5)-(5)=0 and for a length of 5 |
___5 |
like "1235" Note: I try to do length 5, but Excel forgives me and gives the 4 it has available |
Row\Col |
B |
1 |
|
2 |
1,3,5 |
3 |
=LEN(B2) |
4 |
=REPT(" ",B3) |
5 |
=SUBSTITUTE(B2,",",B4) |
6 |
=MID(B5,(1*B3)-(B3-1),B3) |
7 |
=MID(B5,(1*B3)-(B3),B3) |
8 |
|
9 |
1,3,5 |
10 |
=LEN(B9) |
11 |
=REPT(" ",B10) |
12 |
=SUBSTITUTE(B9,",",B11) |
13 |
=MID(B12,(2*B10)-(B10-1),B10) |
14 |
=MID(B12,(2*B10)-(B10),B10) |
15 |
|
16 |
1,3,5 |
17 |
=LEN(B16) |
18 |
=REPT(" ",B17) |
19 |
=SUBSTITUTE(B16,",",B18) |
20 |
=MID(B19,(3*B17)-(B17-1),B17) |
21 |
=MID(B19,(3*B17)-(B17),B17) |
Row\Col |
A |
B |
C |
7 |
I apply to B5 the MID function starting at (1x5)-(5)=0 and for a length of 5 |
#VALUE! |
Excel doesn't forgive me for trying to start at 0 when using MID |
MID( SUBSTITUTE(Text,Delim,REPT(" ",LEN(Text))) , element*LEN(Text)-(LEN(Text)-1) , LEN(Text) )
Test...
MID( SUBSTITUTE(Text,Delim,REPT(" ",LEN(Text))) , (element*LEN(Text)) - (LEN(Text)-1) , LEN(Text) )
MID( SUBSTITUTE(Text,Delim,REPT(" ",LEN(Text))) , (element*LEN(Text)) - ( LEN(Text) ) , LEN(Text) )
Row\Col |
A |
B |
C |
1 |
|
|
What is pseudo is in the Cell to the left ( column B ) |
2 |
Example get the first thing, 1 from the Text string "1,3,5" |
1,3,5 |
my original test text |
3 |
Length |
5 |
the length in characters of my original test text |
4 |
( Rept " " ) x Length |
|
5 spaces like "12345" |
5 |
Substitute in the original string ( B2 ) 5 spaces for each comma seperator |
1_____3_____5 |
like "1123453123455" is 13 characters |
6 |
I apply to B5 the MID function starting at (1x5)-(5-1)=1 and for a length of 5 |
1____ |
like "11234" |
7 |
I apply to B5 the MID function starting at (1x5)-(5)=0 and for a length of 5 |
#VALUE! |
Excel doesn't forgive me for trying to start at 0 !!!! |
8 |
|
|
|
9 |
Example get the second thing, 3 from the Text string "1,3,5" |
1,3,5 |
my original test text |
10 |
Length |
5 |
the length in characters of my original test text |
11 |
( Rept " " ) x Length |
|
5 spaces like "12345" |
12 |
Substitute in the original string ( B9 ) 5 spaces for each comma seperator |
1_____3_____5 |
like "1123453123455" is 13 characters |
13 |
I apply to B12 the MID function starting at (2x5)-(5-1)=6 and for a length of 5 |
_3___ |
like "13123" |
14 |
I apply to B12 the MID function starting at (2x5)-(5)=5 and for a length of 5 |
__3__ |
like "12312" |
15 |
|
|
|
16 |
Example get the third thing, 5 from the Text string "1,3,5" |
1,3,5 |
my original test text |
17 |
Length |
5 |
the length in characters of my original test text |
18 |
( Rept " " ) x Length |
|
5 spaces like "12345" |
19 |
Substitute in the original string ( B16 ) 5 spaces for each comma seperator |
1_____3_____5 |
like "1123453123455" is 13 characters |
20 |
I apply to B19 the MID function starting at (3x5)-(5-1)=11 and for a length of 5 |
__5 |
like "125" Note: I try to do length 5, but Excel forgives me and gives the 3 it has available |
21 |
I apply to B19 the MID function starting at (1x5)-(5)=0 and for a length of 5 |
___5 |
like "1235" Note: I try to do length 5, but Excel forgives me and gives the 4 it has available |
Row\Col |
B |
1 |
|
2 |
1,3,5 |
3 |
=LEN(B2) |
4 |
=REPT(" ",B3) |
5 |
=SUBSTITUTE(B2,",",B4) |
6 |
=MID(B5,(1*B3)-(B3-1),B3) |
7 |
=MID(B5,(1*B3)-(B3),B3) |
8 |
|
9 |
1,3,5 |
10 |
=LEN(B9) |
11 |
=REPT(" ",B10) |
12 |
=SUBSTITUTE(B9,",",B11) |
13 |
=MID(B12,(2*B10)-(B10-1),B10) |
14 |
=MID(B12,(2*B10)-(B10),B10) |
15 |
|
16 |
1,3,5 |
17 |
=LEN(B16) |
18 |
=REPT(" ",B17) |
19 |
=SUBSTITUTE(B16,",",B18) |
20 |
=MID(B19,(3*B17)-(B17-1),B17) |
21 |
=MID(B19,(3*B17)-(B17),B17) |
Row\Col |
A |
B |
C |
7 |
I apply to B5 the MID function starting at (1x5)-(5)=0 and for a length of 5 |
#VALUE! |
Excel doesn't forgive me for trying to start at 0 when using MID |