Using "mid" between two characters

sroot

New Member
Joined
Dec 19, 2013
Messages
8
I have alot of data i am trying to sort into excel and i think i need to use the mid function just not sure how to type this one out right... Here is my example "Variable PCARD0-V9R 2014-08-05 20140711 69.36" assuming this is in A1 what would i do to get everything from 2014 to the last space (this information can always change but it will always be in between a space and the dollar figure) so for this one i would want in another column 2014-08-05 20140711 Any ideas? Thanks!
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

jduley

Board Regular
Joined
May 8, 2014
Messages
64
How about this.
=MID(A1,FIND(" ",A1)+1,(FIND("~",SUBSTITUTE(A1," ","~",LEN(A1)-LEN(SUBSTITUTE(A1," ","")))))-FIND(" ",A1))
 

sroot

New Member
Joined
Dec 19, 2013
Messages
8
That returns PCARD0-V9R 2014-08-05 20140711 i just need 2014-08-05 20140711
 

jduley

Board Regular
Joined
May 8, 2014
Messages
64
Sorry, I missed that "Variable" was part of the string. The formula I posted will not start at the correct position as a result.
 

jduley

Board Regular
Joined
May 8, 2014
Messages
64

ADVERTISEMENT

Try =MID(A1,FIND(" ",A1,FIND(" ",A1)+1)+1,(FIND("~",SUBSTITUTE(A1," ","~",LEN(A1)-LEN(SUBSTITUTE(A1," ","")))))-FIND(" ",A1,FIND(" ",A1)+1))
 

skywriter

Well-known Member
Joined
Feb 15, 2014
Messages
1,642
Here's another solution:


Excel 2010
AB
1Variable PCARD0-V9R 2014-08-05 20140711 69.362014-08-05 20140711
Sheet43
Cell Formulas
RangeFormula
B1=LEFT(RIGHT(A1,LEN(A1)-FIND("2014",A1,1)+1),FIND("|",SUBSTITUTE(RIGHT(A1,LEN(A1)-FIND("2014",A1,1)+1)," ","|",2),1)-1)
 

skywriter

Well-known Member
Joined
Feb 15, 2014
Messages
1,642
Disregard my above post. After looking at your request again, I see I mistakenly thought data you wanted to abstract always started with 2014.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,601
Messages
5,838,287
Members
430,537
Latest member
Antonio11

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