First of all, I wanna thank Mr. Tony Volko ( An Expert at ExcelForum.com ) to provide this beauty.
The Formula I have used is
=TRIM(MID(SUBSTITUTE("|"&B$3,"|",REPT(" ",255)),ROWS(C$1:C1)*255,255))
Dragged down
Here is the explanation…
Lets start from the inside of the formula first.. Ie.
=SUBSTITUTE("|"&B$3,"|",REPT(" ",255)) Syntax [SUBSTITUTE(text, old_text, new_text)]
which is expanded to
'=SUBSTITUTE("|5|3|4|67|10|45|15","|",REPT(" ",255))
It will SUBSTITUTE the "|" with 255 Spaces and will provide the following Text.
"_255_Spaces_5_255_Spaces_3_255_Spaces_4_255_Spaces_67_255_Spaces_10_255_Spaces_45_255_Spaces_15"
Yes, REPT(" ",255) will provide 255 spaces
Now, here comes the trick, The MID Function.
MID(SUBSTITUTE("|"&B$3,"|",REPT(" ",255)),ROWS(C$1:C1)*255,255) Syntax MID(text, start_num, num_chars)
Expended to
MID("_255_Spaces_5_255_Spaces_3_255_Spaces_4_255_Spaces_67_255_Spaces_10_255_Spaces_45_255_Spaces_15", ROWS(C$1:C1)*255, 255)
Text Start_Num Num_Chars
Now here is a VARIABLE which varies when we drag the formula down Ie ROWS(C$1:C1)
It will work like this..
MID("_255_Spaces_5_255_Spaces_3_255_Spaces_4_255_Spaces_67_255_Spaces_10_255_Spaces_45_255_Spaces_15", 1*255, 255)
Will return "_0_Spaces_5_254_Spaces"
MID("_255_Spaces_5_255_Spaces_3_255_Spaces_4_255_Spaces_67_255_Spaces_10_255_Spaces_45_255_Spaces_15", 2*255, 255)
Will return "_1_Spaces_3_253_Spaces"
MID("_255_Spaces_5_255_Spaces_3_255_Spaces_4_255_Spaces_67_255_Spaces_10_255_Spaces_45_255_Spaces_15", 3*255, 255)
Will return "_2_Spaces_4_252_Spaces"
MID("_255_Spaces_5_255_Spaces_3_255_Spaces_4_255_Spaces_67_255_Spaces_10_255_Spaces_45_255_Spaces_15", 4*255, 255)
Will return "_3_Spaces_67_251_Spaces"
MID("_255_Spaces_5_255_Spaces_3_255_Spaces_4_255_Spaces_67_255_Spaces_10_255_Spaces_45_255_Spaces_15", 5*255, 255)
Will return "_4_Spaces_10_250_Spaces"
MID("_255_Spaces_5_255_Spaces_3_255_Spaces_4_255_Spaces_67_255_Spaces_10_255_Spaces_45_255_Spaces_15", 6*255, 255)
Will return "_5_Spaces_45_249_Spaces"
MID("_255_Spaces_5_255_Spaces_3_255_Spaces_4_255_Spaces_67_255_Spaces_10_255_Spaces_45_255_Spaces_15", 7*255, 255)
Will return "_6_Spaces_15_248_Spaces"
Now Using TRIM Function, the result would be. |
|||
5 | |||
3 | |||
4 | |||
67 | |||
10 | |||
45 | |||
15 |
I hope, I have been able to explain it well ..
You can also use FORMULA AUDITING to understand it well more. However if you have any queries then don't hesitate , have a comment..
Regards,
Vikas Gautam
File can be downloaded from here..
Japonya yurtdışı kargo
ReplyDeleteJamaika yurtdışı kargo
İzlanda yurtdışı kargo
İsveç yurtdışı kargo
İsrail yurtdışı kargo
QL23Y