parse the string

TGeorge2

New Member
Joined
Feb 18, 2015
Messages
11

HAVE NEED1 NEED2
111110: Soybean Farming 111110 Soybean Farming
111130: Dry Pea and Bean Farming 111130 Dry Pea and Bean Farming
111140: Wheat Farming 111140 Wheat Farming

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

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
TGeorge2,

If I understand your need correctly then here is one of several ways you can split the string in A

Excel 2007
ABC
1HaveNeed1Need2
2111110: Soybean Farming111110Soybean Farming
3111130: Dry Pea and Bean Farming111130Dry Pea and Bean Farming
Sheet3
Cell Formulas
RangeFormula
B2=LEFT(A2,FIND(":",A2)-1)
C2=SUBSTITUTE(A2,B2&": ","")


Hope that helps.
 
Upvote 0
An alternative in C2 so as to be independent of B2 would be =RIGHT(A2,LEN(A2)-FIND(":",A2)-1)
 
Upvote 0
That should work, additionally, could use the "Text to Columns" feature, with the colon as delimiter.
 
Upvote 0
You could have been clear about your objective. From what you scribbled for us, I think this is what you're after:


Excel 2012
ABC
1111110: Soybean Farming111110Soybean Farming
2111130: Dry Pea and Bean Farming111130Dry Pea and Bean Farming
3111140: Wheat Farming111140Wheat Farming
Sheet34
Cell Formulas
RangeFormula
B1=REPLACE(A1,SEARCH(":",A1,1),LEN(A1),"")
B2=REPLACE(A2,SEARCH(":",A2,1),LEN(A2),"")
B3=REPLACE(A3,SEARCH(":",A3,1),LEN(A3),"")
C1=REPLACE(A1,1,SEARCH(":",A1,1)+1,"")
C2=REPLACE(A2,1,SEARCH(":",A2,1)+1,"")
C3=REPLACE(A3,1,SEARCH(":",A3,1)+1,"")
 
Upvote 0

Forum statistics

Threads
1,203,078
Messages
6,053,404
Members
444,662
Latest member
AaronPMH

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