Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to split the data? office 2003

Status
Not open for further replies.

ravi1982

Mechanical
Apr 14, 2008
20
JP
How to split the data? office 2003

I have the excel data in the format “O##-alphanumeric character” in a single cell,
How can this be divided in to “O##” and “alphanumeric character”, then placed in separate cells

Example: - Data format “O26-Roughing-operation-3” in one cell,
Requirement “O26” and “roughing operation-3” in separate cells
 
Replies continue below

Recommended for you

The Data | Text to colums should work; it's been in Excel since at least 2000. You can either choose delimited, or fixed position.

TTFN

FAQ731-376
 
Sorry slight change in the question
Data format: - LHS-RHS. i.e. (Left hand side)(Hyphen)(Right hand side), important to note that, RHS may contain hyphens

The data should be split and displayed in separate columns, with respect to the first Hyphen, present in the data.
 
For LHS-RHS in column A:
column B = REPLACE(A1,FIND("-",A1,1),10000,"")
column C = REPLACE(A1,1,FIND("-",A1,1),"")

This will put LHS in column B and RHS in column C. Should work as long as the first hyphen (left to right) is the hyphen seperating the 2 sides, and as long as the LHS is less than 10000 characters. Quick and dirty solution, but no VBA macro involved.
 
If your LHS is always the same length, then you can used the fixed position approach to easily split the data.

You can still use hyphen as the limiter, and simply use CONCATENATE to join together the left over RHS bits.

TTFN

FAQ731-376
 
Thank you very much, “Wecos” for your reply, you made it look so simple.

Sorry IRstuff, it was my in efficiency in framing a proper question,
The RHS length varies, but I came to know, how fixed position approach works, thank you very much for your replies.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top