Separate data in a cell to different cells

klllmmm

New Member
Joined
Nov 14, 2015
Messages
13
I have a data set in below type in a column. How can I extract & put them into separate columns.

Code:1+Name:Book+Size:200pg+Price:100+Vendor:Abooks

<tbody>
</tbody><colgroup><col></colgroup>
<strike></strike>
Code:2+Name:Pen+Size:Standard+Price:10+Vendor:Abooks

<tbody>
</tbody><colgroup><col></colgroup>
<strike></strike>
Code:3+Name:Bag+Size:Standard+Price:250+Vendor:TopBags

<tbody>
</tbody><colgroup><col></colgroup>
<strike></strike>

<tbody>
</tbody>

I worked to some extent using below formula.
MID(A1,1,FIND("+",A1)-1) = Code:1 , MID(Q7,FIND("+",A1,1)+1,FIND("+",A1,2)) = Name:Bo

I want to get the data into separate cells as follows;

Code:1<strike></strike>
Name:Book<strike></strike>
Size:200pg<strike></strike>
Price:100<strike></strike>
Vendor:Abooks<strike></strike>
Code:2<strike></strike>
Name:Pen<strike></strike>
Size:Standard<strike></strike>
Price:10<strike></strike>
Vendor:Abooks<strike></strike>
Code:3<strike></strike>
Name:Bag<strike></strike>
Size:Standard<strike></strike>
Price:250<strike></strike>
Vendor:TopBags<strike></strike>

<tbody>
</tbody>
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
I Prefer to use a formula rather than text to column. Data is not in the same order. It's a large chunk of data set. I want to prepare a data table from this data set. Something similar to this.

CodeName Size Price Vendor
1Book200pg100Abooks
2PenStandard10Abooks
3BagStandard250Topbags

<tbody>
</tbody>


Thank you very much for your time & effort.....
 
Upvote 0
You did say -

I want to get the data into separate cells as follows;

Code:1<strike></strike>Name:Book<strike></strike>Size:200pg<strike></strike>Price:100<strike></strike>Vendor:Abooks<strike></strike>
Code:2<strike></strike>Name:Pen<strike></strike>Size:Standard<strike></strike>Price:10<strike></strike>Vendor:Abooks<strike></strike>
Code:3<strike></strike>Name:Bag<strike></strike>Size:Standard<strike></strike>Price:250<strike></strike>Vendor:TopBags

<tbody>
</tbody>


What do you mean by "Data is not in the same order"?
 
Upvote 0
Try

=MID(A1,FIND(":",A1)+1,1)

=MID(A1,FIND("me:",A1)+3,FIND("+S",A1)-3-FIND("me:",A1))

=MID(A1,FIND("ze:",A1)+3,FIND("+P",A1)-3-FIND("ze:",A1))

=MID(A1,FIND("ce:",A1)+3,FIND("+V",A1)-3-FIND("ce:",A1))

=MID(A1,FIND("or:",A1)+3,99)

Code:
[/FONT]
[TABLE="width: 325"]
<!--StartFragment--> <colgroup><col width="65" span="5" style="width:65pt"> </colgroup><tbody>[TR]
  [TD="width: 65"]1[/TD]
  [TD="width: 65"]Book[/TD]
  [TD="width: 65"]200pg[/TD]
  [TD="width: 65"]100[/TD]
  [TD="width: 65"]Abooks[/TD]
 [/TR]
 [TR]
  [TD]2[/TD]
  [TD]Pen[/TD]
  [TD]Standard[/TD]
  [TD]10[/TD]
  [TD]Abooks[/TD]
 [/TR]
 [TR]
  [TD]3[/TD]
  [TD]Bag[/TD]
  [TD]Standard[/TD]
  [TD]250[/TD]
  [TD]TopBags[/TD]
 [/TR]
<!--EndFragment--></tbody>[/TABLE]
[FONT=Lucida Grande]
 
Upvote 0
Thank you vary much Mr. gaz_chops. Its a perfect solution.

I meant by data not in order means sometimes data appears like this too

Code:1+Name:Book+Size:200pg+Price:100+Vendor:Abooks
Code:2+Size:Standard+Name:Pen+Vendor:Abooks+Price:10
Its all-right. Thanks again
 
Upvote 0
Thank you vary much Mr. gaz_chops. Its a perfect solution.

I meant by data not in order means sometimes data appears like this too

Code:1+Name:Book+Size:200pg+Price:100+Vendor:Abooks
Code:2+Size:Standard+Name:Pen+Vendor:Abooks+Price:10
Its all-right. Thanks again

You're welcome, but note that my solution won't work if they are not in the order of your original post.
 
Upvote 0
For items in any order, try this formula copied across and down.

Excel Workbook
ABCDEF
1CodeNameSizePriceVendor
2Code:1+Name:Book+Size:200pg+Price:100+Vendor:Abooks1Book200pg100Abooks
3Code:2+Name:Pen+Size:Standard+Price:10+Vendor:Abooks2PenStandard10Abooks
4Code:3+Name:Bag+Size:Standard+Price:250+Vendor:TopBags3BagStandard250TopBags
5Code:2+Size:Standard+Name:Pen+Vendor:Abooks+Price:102PenStandard10Abooks
6Vendor:Abc+Size:Large+Code:201+Price:20.55+Name:Folder201FolderLarge20.55Abc
Extract Items
 
Upvote 0
Another option,

In B2 enter formula, copy across to F2 and all copy down :

=TRIM(LEFT(SUBSTITUTE(MID($A2,FIND(B$1,$A2&B$1)+LEN(B$1)+1,90),"+",REPT(" ",90)),90))

Regards
 
Upvote 0
.. or with one less function call

=REPLACE(LEFT($A2,FIND("+",$A2&"+",FIND(B$1,$A2))-1),1,FIND(B$1,$A2)+LEN(B$1),"")
 
Upvote 0

Forum statistics

Threads
1,214,422
Messages
6,119,395
Members
448,891
Latest member
tpierce

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