+ Reply to Thread
Results 1 to 2 of 2

Extract numbers from text

  1. #1
    Registered User
    Join Date
    01-07-2008
    Posts
    19

    Extract numbers from text

    Ascot 27th Jul - 14:50 5f Hcap
    Ponte 27th Jul - 14:40 1m4f Hcap
    Salis 26th Jul - 18:35 1m Claim Stks

    I need to extract the distances from text strings as the above examples.

    The text will vary in length but always have "- "

    Some have "m". some "f" and some "m" & "f"

    The "m" = mile, "f" = furlong

    1 mile = 8 furlongs

    Once the number of miles is known I want to convert it to furlongs.

    So if the text reads "1m4f" that equals 1 x 8f =8f + 4f = 12f

    The final result should be 12

    Many thanks

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    You could do that with two formulas. Assuming your data is in A1 then try this formula in B1 to extract the distance as shown, e.g. "1m4f"

    =MID(LEFT(A1,FIND(" ",A1,FIND(":",A1)+4)),FIND(":",A1)+4,10)

    then in C1 to convert to furlongs

    =IF(ISNUMBER(FIND("m",B1)),LEFT(B1,FIND("m",B1)-1))*8+IF(ISNUMBER(FIND("f",B1)),MID(B1,FIND("f",B1)-1,1))

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1