+ Reply to Thread
Results 1 to 8 of 8

Extract fraction from text

  1. #1
    Registered User
    Join Date
    08-12-2019
    Location
    Inverness, Scotland
    MS-Off Ver
    Office 365
    Posts
    2

    Extract fraction from text

    How can I extract a fraction from text?
    e.g. Surf Dancer 4/7 Fav
    I am looking to extract 4/7 in fraction format

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,492

    Re: Extract fraction from text

    Welcome to the forum.

    Based on the only example you've given us:

    =TRIM(MID(A1,FIND("/",A1)-2),5))
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,077

    Re: Extract fraction from text

    Is the fraction ever bigger than 1 e.g. could it be 3 7/8 (three and seven eighths) ?
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  4. #4
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,077

    Re: Extract fraction from text

    Quote Originally Posted by AliGW View Post
    Welcome to the forum.

    Based on the only example you've given us:

    =TRIM(MID(A1,FIND("/",A1)-2),5))
    Ali, does that formula work?
    I'm getting "youve entered too few arguments" error
    Its highlighting the 2 in your formula

  5. #5
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,077

    Re: Extract fraction from text

    Ali's formula should be

    =TRIM(MID(A1,FIND("/",A1)-2,5))

    She added an extra bracket after the 2 which works when removed.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,492

    Re: Extract fraction from text

    Thanks - I write it on the fly!

    As you correctly pointed out, it should be:

    =TRIM(MID(A1,FIND("/",A1)-2,5))

  7. #7
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Extract fraction from text

    All formulas that were suggested, return text. However, if you need to calculate fractions use this formula.

    =IFERROR(--("0 "&TRIM(MID(A1,FIND("/",A1)-2,5))),1)

    v A B
    1 Surf Dancer 4/7 Fav 4/7

    Format cell B1 as Fractions
    Last edited by AlKey; 08-12-2019 at 11:01 AM.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  8. #8
    Registered User
    Join Date
    08-12-2019
    Location
    Inverness, Scotland
    MS-Off Ver
    Office 365
    Posts
    2

    Re: Extract fraction from text

    Hi Folks,
    Thanks for all your replies
    I have just come back in from work and tried the most recent option which works great.
    Thanks Alkey

    =IFERROR(--("0 "&TRIM(MID(A1,FIND("/",A1)-2,5))),1)

    For those who are curious, I am pasting horse racing results from the web into a table, e.g. "Chica De La Noche 4/1" and then extracting the fractional odds to work out the returns.
    And Alkeys formula is perfect for my purposes.
    I will now look at the other options just to get a feel for the formula processes.

    Thanks again for your prompt replies.

    Alkey,
    If you could provide a brief explanation of your formula function that would be great, thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Text Fraction to formula MK2
    By Ian.Lance in forum Excel General
    Replies: 5
    Last Post: 08-30-2018, 03:22 PM
  2. [SOLVED] Add Text prior to fraction
    By colarguns in forum Excel General
    Replies: 16
    Last Post: 07-14-2018, 06:14 AM
  3. Refinancing one fraction selling the other fraction in a context of variable price
    By General Patton in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-18-2017, 07:55 AM
  4. Replies: 3
    Last Post: 09-04-2013, 01:56 AM
  5. Replies: 10
    Last Post: 06-11-2013, 06:11 PM
  6. [SOLVED] Extract fraction from text without converting to date serial number
    By adam2308 in forum Excel General
    Replies: 4
    Last Post: 10-04-2011, 07:29 AM
  7. Replies: 7
    Last Post: 12-17-2010, 04:23 PM

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