Help extracting string - 3 spaces from end of description

MyDogJake

New Member
Joined
Feb 22, 2011
Messages
13
Thanks in advance to any/all help!

I'd like to remove the last string of numbers (actually costs) from a description -post to a separate column -and then, re-combine with original description leaving off comments...

Example:

987654321 6 Snickersbars11/12/14/ DX,T 1.30 .60 3.60 --> desire "1.30 .60 3.60" for separate column
...and then.. re-combine with description such that the "comments; "DX,T" are left out.

Final result:
987654321 6 Snickersbars11/12/14/ 1.30 .60 3.60

Note: the forward slashes are always present and should be included in final result.

Thanks greatly!

PS: I've tried left, mid, rept, right text formulas but can't seem to nail down the spaces over issue?:eek:
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Why not just remove the DX,T ?

=SUBSTITUTE(A1,"DX,T ","")

Thanks for reponding. The trouble with just substituting is that I still need the string on the right (for another column) -Further, there are about 8 -10 different types of comments that would need scrubbing.

Your thoughts appreciated :)
 
Upvote 0
Further, there are about 8 -10 different types of comments that would need scrubbing.
That's why just one sample piece of data can be misleading. Perhaps we could have 4 or 5 more, with their respective expected results? That might help us understand ..

1. How to determine what has to be left out & what has to be kept.
2. Whether the "last string of numbers" is always 3 numbers or not.
etc
 
Upvote 0
Assuming the column that the three ending numbers will go in is Column B starting at Row 7 (hard to tell from your picture, so I had to guess), then put these formulas in the indicated cells and copy down...

B7: =TRIM(RIGHT(SUBSTITUTE(TRIM(A7)," ",REPT(" ",200)),600))

C7: =TRIM(LEFT(SUBSTITUTE(TRIM(A7)," ",REPT(" ",100)),300))&" "&B7
 
Upvote 0
Assuming the column that the three ending numbers will go in is Column B starting at Row 7 (hard to tell from your picture, so I had to guess), then put these formulas in the indicated cells and copy down...

B7: =TRIM(RIGHT(SUBSTITUTE(TRIM(A7)," ",REPT(" ",200)),600))

C7: =TRIM(LEFT(SUBSTITUTE(TRIM(A7)," ",REPT(" ",100)),300))&" "&B7

Thanks Rick - the first formula correctly pulls the last string...but the second formula does not pull the entire left string up to and including the very last "/" ... is there a tweak we can do?

Thank you.
 
Upvote 0
Thanks Rick - the first formula correctly pulls the last string...but the second formula does not pull the entire left string up to and including the very last "/" ... is there a tweak we can do?
Sorry, I forgot to modify my base formula for the slash delimiter. Try this version of my formula...

=TRIM(LEFT(SUBSTITUTE(TRIM(A1),"/",REPT(" ",100)),300))&"/ "&H1
 
Upvote 0
Sorry, I forgot to modify my base formula for the slash delimiter. Try this version of my formula...

=TRIM(LEFT(SUBSTITUTE(TRIM(A1),"/",REPT(" ",100)),300))&"/ "&H1

Yes! that works :)
...no there's just one more "tweak" ... I failed to notice that a "%" could be used in the costing information instead of a unit value... if a "%" is thrown in the mix the string would need to go to 4 spaces

example:
987654321 6 Snickersbars11/14/14 DT,X 3.12 5 % .94 ...in this case we'd want to extract "3.12 5 % .94"

Thank you kindly Rick for your consideration.
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,707
Members
448,981
Latest member
recon11bucks

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