Mid, left right extract.

srizki

Well-known Member
Joined
Jan 14, 2003
Messages
1,831
Office Version
  1. 365
Platform
  1. Windows
I am using formula =MID(G8,LEFT(32,255),6) OR =MID(G8,32,6) same thing.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
My question is whaat if there are not always 32 characters before the required value, or the value on the right of the is always 5 digit and characters on the left of the value are not the same. <o:p></o:p>
So for example. <o:p></o:p>
<o:p> </o:p>
February 2009 Biomed Charges to 50051-6510<o:p></o:p>
I want to extract 50051, so what will be the better formula than the one I am using.<o:p></o:p>
<o:p> </o:p>
Thanks<o:p></o:p>
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Is the number at the end allways ?????-???? it means 5 digits - 4 digits
 
Upvote 0
you search for the position of text " to ", add the 4 characters of " to " to extract your 5 digit number:

=MID(A1,SEARCH(" to ",A1)+4,5)

unfortunately may not work in all thinkable cases ...
 
Upvote 0
=LEFT(RIGHT(A1,10),5)<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
 
Upvote 0

Forum statistics

Threads
1,212,933
Messages
6,110,751
Members
448,295
Latest member
Uzair Tahir Khan

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