+ Reply to Thread
Results 1 to 9 of 9

Convert Day and Month into Fraction

  1. #1
    Forum Contributor
    Join Date
    01-08-2013
    Location
    Jacksonville, Fl
    MS-Off Ver
    Excel 2016
    Posts
    355

    Convert Day and Month into Fraction

    Hi everyone,

    I have some data that I exported from our ERP i.e, "COMP. .003 X 5/8 REV B, C, D E OR F".
    I want to extract the the fraction from the string, i.e "5/8", into an independent cell.
    To do this I preformed a Text to Columns and it worked great with one issue. The "5/8" is being looked at as a Date by Excel. I need to take the Date value "5/8" and make it a fraction "5/8".
    Simply changing the format to fractions only gives me a very large whole number i.e "42863".

    Can someone please help me with an easy way to accomplish this for a large amount of data?

    As always, Thank you.

    - Justin

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Convert Day and Month into Fraction

    You can use a formula such as this (below) to extract the date from the string in the given format.

    =DATEVALUE(MID(A1,FIND("/",A1)-1,3))

    You can also use Text to Columns if you prefer that.

    Then format the cell as Date.

    Excel sees dates as numbers. Specifically, 5/8/2017 is 42863 days after 1/0/1900 (a.k.a. 0)
    Last edited by 63falcondude; 05-30-2017 at 02:04 PM.

  3. #3
    Forum Contributor
    Join Date
    01-08-2013
    Location
    Jacksonville, Fl
    MS-Off Ver
    Excel 2016
    Posts
    355

    Re: Convert Day and Month into Fraction

    Quote Originally Posted by 63falcondude View Post
    You can use a formula such as this (below) to extract the date in the given format.

    =DATEVALUE(MID(A1,FIND("/",A1)-1,3)&"/"&YEAR(TODAY()))
    Thank you for the reply but I need the value to be a fraction (5/8 aka .63), not a date.

  4. #4
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Convert Day and Month into Fraction

    Quote Originally Posted by Justair07 View Post
    Thank you for the reply but I need the value to be a fraction (5/8 aka .63), not a date.
    I misunderstood. Try this:

    =("0 "&MID(A1,FIND("/",A1)-1,3))+0

  5. #5
    Forum Contributor
    Join Date
    01-08-2013
    Location
    Jacksonville, Fl
    MS-Off Ver
    Excel 2016
    Posts
    355

    Re: Convert Day and Month into Fraction

    Quote Originally Posted by 63falcondude View Post
    I misunderstood. Try this:

    =("0 "&MID(A1,FIND("/",A1)-1,3))+0
    Very cool! I'd love to know how that works. Also, anyway to make it work for two digit fractions, i.e 25/32?

  6. #6
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    Win10/MSO2016
    Posts
    12,977

    Re: Convert Day and Month into Fraction

    removed by bvj
    Last edited by protonLeah; 05-30-2017 at 03:33 PM.
    Ben Van Johnson

  7. #7
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Convert Day and Month into Fraction

    Quote Originally Posted by Justair07 View Post
    Very cool! I'd love to know how that works.
    If you want to enter a fraction into a cell, you enter "0 " (that is "zero space") before the fraction.

    The FIND function finds the location of the leftmost "/" (minus 1) and the MID function pulls out the first 3 characters starting in that position.

    You add a zero at the end to tell Excel to treat it as a number and not as text.

    Also, anyway to make it work for two digit fractions, i.e 25/32?
    Try this one:

    =TRIM("0 "&MID(A1,FIND("/",A1)-2,5))+0
    Last edited by 63falcondude; 05-30-2017 at 02:28 PM.

  8. #8
    Forum Contributor
    Join Date
    01-08-2013
    Location
    Jacksonville, Fl
    MS-Off Ver
    Excel 2016
    Posts
    355

    Re: Convert Day and Month into Fraction

    Thank you so much! That is exactly what I needed falcon.

    Ben, thank you as well. No I now how to properly use text to columns!

  9. #9
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Convert Day and Month into Fraction

    Quote Originally Posted by Justair07 View Post
    Thank you so much! That is exactly what I needed falcon.

    Ben, thank you as well. No I now how to properly use text to columns!
    You're welcome. Happy to help!

+ 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. 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
  2. Conver xml to xls
    By sam51285 in forum Excel General
    Replies: 2
    Last Post: 08-04-2015, 04:41 AM
  3. want to conver 1.45 in to mintues
    By anjana arora in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-12-2014, 03:55 PM
  4. Replies: 3
    Last Post: 09-04-2013, 01:56 AM
  5. Replies: 10
    Last Post: 06-11-2013, 06:11 PM
  6. Replies: 7
    Last Post: 12-17-2010, 04:23 PM
  7. how to conver #n/a's to 0
    By ray500 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-29-2006, 03:39 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