Monday, October 17, 2011

There is more than one way to skin a Cat

Before SPCA and animal lovers go up in arms, I must disclaim here, this is a idiom, ok?

Anyway, recently I realized that using excel formula can complement and expedite sql extractions (sorry if it sounds unclear, but I cannot divulge too many details). For my own reference and knowledge sharing, here goes:

To retrieve a certain part of a string
Example
extract 3 from I love you :-3  (assuming in cell A60)

use a new column with the formula =MID(A60, FIND (":", A60)+1,2). It will retain -3.
The Mid function extracts a substring from a string (starting at any position), while FIND function finds the position in the cell. If you want the string after :, then use +1 as the starting position after :, i.e. -.

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails