I tried this formulae in excel 2007 but throws me error [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=Value]#Value [/URL] . Can u plz check again
Book1 | ||||
---|---|---|---|---|
D | E | |||
1 | 9883;3883;0;405;0;567 | 0;0;0;6160;1718;3191;3203;0;1 | ||
2 | 9883 | 6160 | ||
3 | 3883 | 1718 | ||
4 | 405 | 3191 | ||
5 | 567 | 3203 | ||
6 | 1 | |||
7 | ||||
8 | ||||
Sheet33 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
D2 | =IFERROR(TRIM(MID(SUBSTITUTE(SUBSTITUTE(";"&D$1,";0",""),";",REPT(" ",100)),ROW(D1)*100,100))+0,"") |
Book1 | ||||
---|---|---|---|---|
E | F | |||
1 | 0;0;0;6160;1718;3191;3203;0;1 | 6473;6473;6379;768;0;0;6704;6240;36;9079;9079;2310;4809;4280 | ||
2 | 6160 | 6473 | ||
3 | 1718 | 6473 | ||
4 | 3191 | 6379 | ||
5 | 3203 | 768 | ||
6 | 1 | 6704 | ||
7 | 6240 | |||
8 | 36 | |||
9 | 9079 | |||
10 | 9079 | |||
11 | 2310 | |||
12 | 4809 | |||
13 | 4280 | |||
Sheet33 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
E2 | =IFERROR(TRIM(MID(SUBSTITUTE(SUBSTITUTE(";"&E$1,";0",""),";",REPT(" ",100)),ROW(E1)*100,100))+0,"") |
ok, I know what's the problem. This string can vary may be upto 3000 characters. this formula doesn't work when the string increases by length. Can you please help?
[TABLE="width: 113"]
<tbody>[TR]
[TD]0;680;1734;14603;14603;14603;14603;14603;14603;14603;14603;14603;14603;14603;14603;14603;14603;4719;6121;6160;6379;9610;7298;1756;17682;4975;795
[/TD]
[/TR]
</tbody>[/TABLE]
Excel 2010 | ||||
---|---|---|---|---|
C | E | |||
1 | 0;0;0;6160;1718;3191;3203;0;1 | 0;680;1734;14603;14603;14603;14603;14603;14603;14603;14603;14603;14603;14603;14603;14603;14603;4719;6121;6160;6379;9610; 7298;1756;17682;4975;795 | ||
2 | 6160 | 680 | ||
3 | 1718 | 1734 | ||
4 | 3191 | 14603 | ||
5 | 3203 | 14603 | ||
6 | 1 | 14603 | ||
7 | 14603 | |||
8 | 14603 | |||
9 | 14603 | |||
10 | 14603 | |||
11 | 14603 | |||
12 | 14603 | |||
13 | 14603 | |||
14 | 14603 | |||
15 | 14603 | |||
16 | 14603 | |||
17 | 14603 | |||
18 | 4719 | |||
19 | 6121 | |||
20 | 6160 | |||
21 | 6379 | |||
22 | 9610 | |||
23 | 7 | |||
24 | 298 | |||
25 | 1756 | |||
26 | 17682 | |||
27 | 4975 | |||
28 | 795 | |||
Sheet13 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
C2 | =IFERROR(TRIM(MID(SUBSTITUTE(SUBSTITUTE(";"&C$1,";0",""),";",REPT(" ",100)),ROW(C1)*100,100))+0,"") |
[table="width: 500"]
[tr]
[td]Sub SplitDown()
Dim Cell As Range, Arr() As String
Application.ScreenUpdating = False
For Each Cell In Range("A1", Cells(1, Columns.Count).End(xlToLeft))
Arr = Split(Application.Trim(Replace(" " & Replace(Cell.Value, ";", " ") & " ", " 0", " ")))
Cell.Offset(1).Resize(UBound(Arr) + 1) = Application.Transpose(Arr)
Next
Application.ScreenUpdating = True
End Sub[/td]
[/tr]
[/table]
6473;6473;6379;768;0;0;6704;6240;36;9079;9079;2310;4809;4280
when I use this formulae it excludes zero but it exclude the first number and returns as shown below
=TRIM(MID(SUBSTITUTE(";"&SUBSTITUTE(A$2,";0",""),";",REPT(" ",100)),ROW(A2)*100,100))
if you see below, it skips first item of the string. Plz advise.
[TABLE="width: 64"]
<tbody>[TR]
[TD="class: xl66, width: 64, bgcolor: transparent"]6473
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]6379
[/TD]
[/TR]
[TR]
[TD="class: xl67, bgcolor: transparent"]768
[/TD]
[/TR]
[TR]
[TD="class: xl67, bgcolor: transparent"]6704
[/TD]
[/TR]
[TR]
[TD="class: xl67, bgcolor: transparent"]6240
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]36
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]9079
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]9079
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]2310
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]4809
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]4280
[/TD]
[/TR]
</tbody>[/TABLE]
if you see 5th last row, it shows "7" instead of "7298. I was getting such incorrect data values.
Excel 2010 | |||
---|---|---|---|
E | |||
1 | 0;680;1734;14603;14603;14603;14603;14603;14603;14603;14603;14603;14603;14603;14603;14603;14603;4719;6121;6160;6379;9610;7298;1756;17682;4975;795;12345;45678 | ||
2 | 680 | ||
3 | 1734 | ||
4 | 14603 | ||
5 | 14603 | ||
6 | 14603 | ||
7 | 14603 | ||
8 | 14603 | ||
9 | 14603 | ||
10 | 14603 | ||
11 | 14603 | ||
12 | 14603 | ||
13 | 14603 | ||
14 | 14603 | ||
15 | 14603 | ||
16 | 14603 | ||
17 | 14603 | ||
18 | 4719 | ||
19 | 6121 | ||
20 | 6160 | ||
21 | 6379 | ||
22 | 9610 | ||
23 | 7298 | ||
24 | 1756 | ||
25 | 17682 | ||
26 | 4975 | ||
27 | 795 | ||
28 | 12345 | ||
29 | 45678 | ||
Sheet13 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
E2 | =IFERROR(MID(SUBSTITUTE(SUBSTITUTE(";"&E$1,";0",""),";",REPT(" ",100)),ROW(E1)*101,100)+0,"") |