Strip data from cell

amerifax

Board Regular
Joined
Dec 17, 2008
Messages
247
I have a cell with the following"
2 872102 - ACCOUNTING & BOOKKEEPING GENERAL SVC
15+ 651202 - OFFICE BUILDINGS & PARKS
15+ 753801 - AUTOMOBILE REPAIRING & SERVICE

The zeros after the 2 are not consistent, anywhere from 2 to 5 zeros.
I'm trying to strip out the description number, which is 872102 and also the description. I am able to strip out the description using the following:
=RIGHT(Q31,LEN(Q31)-SEARCH(" - ",Q31)-2)

I have tried many ways to strip out the description number with no luck.
872102

I was hoping to be able to strip them both out to the appropriate column:
P. description number
Q. description

I have been able to strip out the 2 that can be at times, a 1,2 or 3 character value such as 15+. Here I was able to use =Left(Q2,3)
Thanks
 
Last edited:

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
I put your example in A1

This formula in b1 gets the description number
=MID(A1,FIND(" ",A1,1)+1,6)

This formula in c1 gets the description
=MID(A1,FIND("- ",A1,1)+2,99)

Hope that helps...


(I assumed the description number is always after the first space and the description is always after the -)
 
Upvote 0
Description worked perfect.

Item Number was not working well. I should have mentioned that " - " is very consistent.
I have done the following to make it work.my concern is I'm doing it where it won't come back to haunt me in the future. I believe I have followed your lead, and converted the -6,6 appropriately
=MID(R2,FIND(" -",R2,1)-6,6)

Thanks again for your excellent and prompt help
 
Upvote 0

Forum statistics

Threads
1,224,584
Messages
6,179,691
Members
452,938
Latest member
babeneker

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