• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Text 2 Columns with certain conditions

karthick87

Member
I have a data which I would like to convert into "Text to columns" but with certain conditions like the following.

1. The text before the numeric characters has to be in 1 column and when the numeric character starts we should apply "Text to Column" with space as delimiter.

I have attached a sample excel file here to give better understanding ( it contains two sheets (Raw_Format and Expected_Output)).
 

Attachments

  • Data.xlsx
    10.5 KB · Views: 8
Hi !

The easy way for using Text To Column Excel inner feature :
insert a comma between each part !
As here obviously space may not be a valid delimiter …

First number always starts by 1 ?
 
Try this formula solution.

1] In "Expected_Format" sheet A1, copied down :

=IF(Raw_Format!A1="","",LEFT(Raw_Format!A1,MIN(FIND({0,1,2,3,4}+{0;5},Raw_Format!A1&1/17))-2))

2] In "Expected_Format" sheet B1, copied across to D1 and all copied down :

=IF(Raw_Format!$A1="","",TRIM(LEFT(RIGHT(SUBSTITUTE(Raw_Format!$A1," ",REPT(" ",30)),(4-COLUMN(A1))*30),30)))

Regards
Bosco
 

Attachments

  • SplitCellData.xlsx
    11.2 KB · Views: 7
Back
Top