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>
 

klllmmm

New Member
Joined
Nov 14, 2015
Messages
13
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.....
 

gaz_chops

Well-known Member
Joined
Apr 29, 2003
Messages
5,890
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"?
 

gaz_chops

Well-known Member
Joined
Apr 29, 2003
Messages
5,890
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]
 

klllmmm

New Member
Joined
Nov 14, 2015
Messages
13
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
 

gaz_chops

Well-known Member
Joined
Apr 29, 2003
Messages
5,890
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.
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
42,231
Office Version
365
Platform
Windows
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:Abooks Book200pg100Abooks
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
 

bosco_yip

Well-known Member
Joined
Dec 2, 2002
Messages
1,938
Office Version
2019
Platform
Windows
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
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
42,231
Office Version
365
Platform
Windows
.. or with one less function call

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

Forum statistics

Threads
1,081,845
Messages
5,361,663
Members
400,643
Latest member
RockStar89

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top