How to extract vareid length figures from mixed char length strings in excel -
i have been tasked extracting data report. have added in our script software tells how long call advisor has spent in script. right in middle of string, strings vary in length.
i have added in underscores either side of text need extract make easier, ideally use 1 underscore @ end separate it. below examples of how strings appear:
zz test script testing only: inventory test; yes; time spent in script:11
hi, have received call ms customer regarding issue: ..._time spent in script:123_q1 = want task?: a1 = 'other'....
what after way extract numerical figure after: "time spent in script:" these figures can between 1-4 characters in length. potentially 5 unlikely. way have tried extract characters left of second underscore (i can remove first underscore future reports not have this), on assumption there no other underscores in string. have email addresses in there , number of have underscores.
i know there number of ways this, been stuck on hours, come sql background, excel not forte.
although following describes more roundabout way of getting answer, avoid need macros.
assuming string in a1
:
b1 (starting character of target string): =find("time spent in script:",a1)
c1 (length of target string): =len("time spent in script:") = 21
d1 (location of first "_" after target string): =find("_",a1,b1)
e1 (result): =int(mid(a1,b1+c1,d1-b1-c1))
Comments
Post a Comment