# Extract text from cell with shifting lenghts

1. ## Extract text from cell with shifting lenghts

Hi much beloved forum!

I am looking for a way to extract text from a single cell into several other cells. I am currently using find and mid functions but quickly realized that this is not going to work when the lenght of the text is changing. Is this even possible?

The only thing that is constant is the delimiting "/" and the values in between (5 values).

Example of series:

100,1/90,5666/1004/10000/44455

Which next time might look something like:

90/10,20/56/4554/112,2

The ideal result would look something like when each cell has a single value:

90 in C1
10,20 in C2
56 in C3
4554 in C4
112,2 in C5

Any suggestions of how to construct the formula? Or do you have to have 5 separate formulas?

Best regards,

2. ## Re: Extract text from cell with shifting lenghts

=trim(mid(substitute(a\$1,"/",rept(" ",99)),row(a1)*99-98,99))

3. ## Re: Extract text from cell with shifting lenghts

Thanks for a very quick reply! I will check and revert!

4. ## Re: Extract text from cell with shifting lenghts

Truly amazing work and it works like a charm ! Thank you very much!

5. ## Re: Extract text from cell with shifting lenghts

You're Welcome!

6. ## Re: Extract text from cell with shifting lenghts

Originally Posted by Teethless mama
=trim(mid(substitute(a\$1,"/",rept(" ",99)),row(a1)*99-98,99))
Using ROW(A1) leaves the formula vulnerable to new row insertions.

Insert a new row 1 and see what happens to the results.

Using the ROWS() function is more robust.

=TRIM(MID(SUBSTITUTE(A\$1,"/",REPT(" ",99)),ROWS(C\$1:C1)*99-98,99))

There are currently 1 users browsing this thread. (0 members and 1 guests)