Sunday, July 24, 2011

yogi_Extract Data Between Two Specified Characters With The Character Appearing At Different Places In A String

Yogi Anand, D.Eng, P.E.                                         Google Spreadsheet                  

Lit said:
How do I extract specifc data between two ' apostrophes when there are four apostrophes at different places in the cell?
My data has the following text in cell column A, cells 2 through 600.
xxxxxxxxxx['K0143M678Z'] = '0';
I need to only pull out the data starting after the first apostrophe which is after the first "[" (box bracket).
The data after the apostrophe changes i.e., it may become '1x34xs24xx' and won't always be "K" but it will more than likely stay limited to 10 characters
In the following I present my convoluted solution for a generalized case in regard to the character used and the starting and ending position of the character.