Doing both right and left trims in the same cell at the same time

livmun

New Member
Joined
Feb 6, 2014
Messages
8
I have successfully used RIGHT/LEFT/LEN/MID in the past but can't get this one to work. I have a text string with numbers I want to extract but the text in front is varying lengths whereas the text behind is the same length. The numbers are enclosed by brackets with should make it easier but then there are some other words in brackets in some of the cells so the FIND didn't work there. All the numbers start with 4 so I can extract everything after 4 but still have the text after the numbers so, I can't think of a way to combine everything to leave just the numbers.
E.G.
hdjfhf (IP) (409) hgutns
hhhfg (499) hgutns
ty (IP) (455) hgutns
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
One option
=MID(A11,FIND(4,A11),FIND(")",A11,FIND(4,A11))-FIND(4,A11))
 
Upvote 0
Are you numbers always 3-digits long? If so, try...

=0+MID(A1,FIND("(4",A1)+1,3)

otherwise try...

=0+MID(LEFT(A1,LEN(A1)-8),FIND("(4",A1)+1,LEN(A1))
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,876
Members
449,056
Latest member
ruhulaminappu

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