+ Reply to Thread
Results 1 to 6 of 6

Turn a fraction around, then show it as a decimal

  1. #1
    Forum Contributor
    Join Date
    08-21-2010
    Location
    Bournemouth, England
    MS-Off Ver
    Microsoft 365
    Posts
    215

    Turn a fraction around, then show it as a decimal

    Hello.
    Is it possible to enter a fraction into A1, say 5/8, then automatically reverse the numerator and denominator so that the fraction shows as 8/5 in B1 and then convert it into a decimal, so the final result reads 1.6 in C1?

    Thank you.

  2. #2
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Turn a fraction around, then show it as a decimal

    may be below
    In A1 type =5/8 and in B1 copy paste below

    =INDEX(TRIM(MID(SUBSTITUTE(TEXT(A1,"???/???"),"/",REPT(" ",50)),{1,30},50)),,2)/INDEX(TRIM(MID(SUBSTITUTE(TEXT(A1,"???/???"),"/",REPT(" ",50)),{1,30},50)),,1)

    To see the reverse numerator and denominator set the cell formatting to fraction
    Last edited by hemesh; 01-16-2016 at 07:14 PM.
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,837

    Re: Turn a fraction around, then show it as a decimal

    Is the fraction entered as a number or as a text string? If the fraction is a real number (0.625 formatted as #/#), then it should be as simple as =1/B1 formatted as general or 0.0 or whatever number format you want.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Forum Contributor
    Join Date
    08-21-2010
    Location
    Bournemouth, England
    MS-Off Ver
    Microsoft 365
    Posts
    215

    Re: Turn a fraction around, then show it as a decimal

    Quote Originally Posted by hemesh View Post
    may be below
    In A1 type =5/8 and in B1 copy paste below

    =INDEX(TRIM(MID(SUBSTITUTE(TEXT(A1,"???/???"),"/",REPT(" ",50)),{1,30},50)),,2)/INDEX(TRIM(MID(SUBSTITUTE(TEXT(A1,"???/???"),"/",REPT(" ",50)),{1,30},50)),,1)

    To see the reverse numerator and denominator set the cell formatting to fraction
    That works, but the fractions will be copied and pasted from another location and I don't want to have to enter the equal sign to each one. I've spent weeks reversing the fraction manually and then converting it into a decimal. I was hoping to just copy and paste and then have the rest performed automatically.
    Thank you for your help.

  5. #5
    Forum Contributor
    Join Date
    08-21-2010
    Location
    Bournemouth, England
    MS-Off Ver
    Microsoft 365
    Posts
    215

    Re: Turn a fraction around, then show it as a decimal

    Quote Originally Posted by MrShorty View Post
    Is the fraction entered as a number or as a text string? If the fraction is a real number (0.625 formatted as #/#), then it should be as simple as =1/B1 formatted as general or 0.0 or whatever number format you want.
    That's works exactly as I want it to! (easy when you know how)
    I'll play around with both solutions before deciding which one to use. Thank you both so much for your help.

  6. #6
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Turn a fraction around, then show it as a decimal

    hello tom if have entries as 5/8 or 8000/60000 and so on then use below
    in B1 assuming ur data is in A1
    =INDEX(--(MID(SUBSTITUTE(TEXT(A1,"???/???"),"/",REPT(" ",50)),{1,50},50)),2)/INDEX(--(MID(SUBSTITUTE(TEXT(A1,"???/???"),"/",REPT(" ",50)),{1,50},50)),1)

+ 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. decimal to fraction
    By itselflearn in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-06-2015, 11:04 AM
  2. Replies: 9
    Last Post: 06-18-2014, 05:41 AM
  3. Convert fraction to a decimal
    By Dillons Grandpa in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 02-24-2013, 12:49 PM
  4. [SOLVED] Fraction to Decimal
    By Michael D in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-13-2013, 03:21 PM
  5. [SOLVED] How do I turn a fraction into a decimal?
    By ad9051 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 02-04-2013, 01:04 PM
  6. [SOLVED] Unusual fraction to decimal
    By honkin in forum Excel General
    Replies: 10
    Last Post: 07-03-2012, 08:35 PM
  7. Decimal To Fraction (Inches)
    By mgaworecki in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-07-2008, 11:47 AM

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