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

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

PCL

Well-known Member
Joined
Jul 15, 2008
Messages
1,356
Is the number at the end allways ?????-???? it means 5 digits - 4 digits
 
Upvote 0

carsten

New Member
Joined
Mar 5, 2009
Messages
15
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

lenze

Legend
Joined
Feb 18, 2002
Messages
13,690
Maybe
Code:
=MID(G8,FIND("-",G8)-5,5)

lenze
 
Upvote 0

Osvaldo Palmeiro

Well-known Member
Joined
Feb 24, 2009
Messages
727
Office Version
  1. 365
Platform
  1. Windows
=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,191,399
Messages
5,986,365
Members
440,020
Latest member
IfsandSums

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
Top