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
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
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.
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.
Ali's formula should be
=TRIM(MID(A1,FIND("/",A1)-2,5))
She added an extra bracket after the 2 which works when removed.
Thanks - I write it on the fly!
As you correctly pointed out, it should be:
=TRIM(MID(A1,FIND("/",A1)-2,5))
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
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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks