Extract from text string, separated by "**"

c_radford

New Member
Joined
Nov 17, 2011
Messages
16
Hi everyone,

I'm scratching my head as to how to resolve the problem of extracting text from a cell into a number of separate cells and I'm hoping you good people can help!

In cell A1, I have a lengthy text string separated by a number of asterisks ("**") and I need to separate the text between these asterisks out into individual cells. For example, in cell A1, my raw text string says:

Name ** Support Provided ** Job Title ** Day Worked ** Hours Worked ** Manager ** Other Detail.

I need to establish how to separate it out so that the Name Data appears in column B, the Support Provided data appears in column C, Job Title in Column D, and so on. The 'Name' data was easy enough to do using =(LEFT(a2,FIND(" **",a2)-1)) but I'm struggling with the rest. One issue which may cause problems is that there is not a set number of characters that appears between each set of asterisks.

I hope this makes sense - any assistance with this issue would be really appreciated as I've been trying to work out how to do it for ages but with little success!

Thanks!
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
TextToColumns with delimiter * should work. You will get some empty columns that way but those can be deleted
 
Upvote 0
If you want a formula solution (so that you can change data in Column A without having to rerun Text To Columns, then put this formula in B2 and copy it across as many cells as you think the maximum number of fields there could ever be, then copy all those cells down as far as you think you will ever need...

=IF($A2="","",IF(COLUMN(A2)=1,LEFT($A2,FIND("**",$A2)-1),TRIM(MID(SUBSTITUTE($A2,"**",REPT(" ",LEN($A2))),LEN($A2)*(COLUMN(A2)-1),LEN($A2)))))
 
Upvote 0

Forum statistics

Threads
1,215,507
Messages
6,125,212
Members
449,214
Latest member
mr_ordinaryboy

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