Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Oct 2005
    Location
    Calgary, Alberta
    Posts
    205
    Thanks
    0
    Thanked 1 Time in 1 Post

    cut string (2003)

    m

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: cut string (2003)

    <P ID="edit" class=small>(Edited by sdckapr on 09-Dec-05 14:47. Added PS)</P>Assuming they are always 2 place numbers:

    <pre>=VALUE(MID(A1,SEARCH("% MeOH",A1)-2,2))</pre>


    Steve

    PS. If it can be 1,2,3 or more figures, but will always be sandwiched between "mg/L)/" and "% MEOH" you can use:
    <pre>=VALUE(MID(A1,SEARCH("mg/L)/",A1)+6,SEARCH("% MeOH",A1)-SEARCH("mg/L)/",A1)-6))</pre>


  3. #3
    2 Star Lounger
    Join Date
    Oct 2005
    Location
    Calgary, Alberta
    Posts
    205
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: cut string (2003)

    hi steve,
    The possibilities are that the MeOH % will either be a 1 digit % or 2 digit % and always have MeOH after the amount. but not always have mg/L.
    So your first solution works but as soo as i use only one % it gets a error. Do you know anything else that might work?



    m

  4. #4
    2 Star Lounger
    Join Date
    Oct 2005
    Location
    Calgary, Alberta
    Posts
    205
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: cut string (2003)

    =SUBSTITUTE(MID(A1,FIND("% MeOH",A1)-2,2),"/","") this might be a possibility works for me

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: cut string (2003)

    If you want the result to be a number, use

    =1*SUBSTITUTE(MID(A1,FIND("% MeOH",A1)-2,2),"/","")

    or

    =VALUE(SUBSTITUTE(MID(A1,FIND("% MeOH",A1)-2,2),"/",""))

  6. #6
    2 Star Lounger
    Join Date
    Oct 2005
    Location
    Calgary, Alberta
    Posts
    205
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: cut string (2003)

    ya that sounds good thanks

  7. #7
    2 Star Lounger
    Join Date
    May 2005
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: cut string (2003)

    I have tried the search command and then from there move back 3 to the left get the numbe with the % and cut the % of by a substitue function but no luck

    Substitute("%",Right(Search(MeOH,statement)-3),statement),"")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •