Conditional Data Parsing...

GGK

New Member
Joined
Oct 4, 2011
Messages
40
I need to set up a formula to grab partial data from a cell at a fixed startpoint and end point.

EXAMPLE:

<IGNORE="DONOTUSE_DONOTUSE_DONOTUSE;DK=[DONOTUSE];>
<BYPASS>language='ignoreall'Because="ThisisBADdataThisisBADdata;stuff=10x20;DR=[BadStuff];PEP=[Cherry]">
<PASS="PASSPASSPASS;ONE=2;TWO=3;OK=20x10;BS=[HUH};UCONN=[NOW]?">
NEED="NEEDTHIS_NEEDTHISNOW_THISISIT;butignorealltherestofthis;worthless=[dontneed]"
<PLEASE>
<HELPME>

If i paste the above text into a cell... how can I get the BOLD DATA ONLY, into another cell. (so its all data between NEED=" and the ; is put into the new cell?

Thanks!

Thanks,
GGK
 
Last edited:
Give this formula a try...

=MID(LEFT(A1,FIND(";",A1)-1),SEARCH("NEED=""",A1)+6,LEN(A1))
Thanks... i'm curious.. if is it possible to put an "OR" function part of the formula... for example... can it extract all data from NEED= all the way to a ";" OR ":" .... whichever comes first..
I would just replace any colons with semi-colons in the FIND function and leave the rest of the formula the way it is...

=MID(LEFT(A1,FIND(";",SUBSTITUTE(A1,":",";"))-1),SEARCH("NEED=""",A1)+6,LEN(A1))

You can do a similar thing with Kelbo's SEARCH function that looks for the semi-colon (change his A3 inside that function call to SUBSTITUTE(A3,":",";").
 
Upvote 0

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
I would just replace any colons with semi-colons in the FIND function and leave the rest of the formula the way it is...

=MID(LEFT(A1,FIND(";",SUBSTITUTE(A1,":",";"))-1),SEARCH("NEED=""",A1)+6,LEN(A1))

You can do a similar thing with Kelbo's SEARCH function that looks for the semi-colon (change his A3 inside that function call to SUBSTITUTE(A3,":",";").


I'm still running into difficulties due to the fact that the start/stop points, that should have been constants... have turned into at least 2 different variables.. possibly more soon. I'm wondering if maybe i should be working off a vlookup?

Here is what i'm working with so far.. AND IT WORKS.. thanks guys... but now i have 2 different, possible start points... with 3 different possible end points (while having to extract the data in between. How would I add another start point? "flag" (and now "banner"..... end points are now 3... ;red, ;white, or ;blue.


so far:

=MID(B2,SEARCH("flag=",B2)+9,MIN(SEARCH(";red",MID(B2,SEARCH("flag=",B2)+9,255)),SEARCH(";white",MID(B2,SEARCH("flag=",B2)+9,255)))-1)
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

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