Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 1
Default Converting Fraction that is in text form into decimal

Import data with fractions like this 44"1/16 so it reads it as text and not number. I need a formula to turn it into decimal numbers so I can use them in equations.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,872
Default Converting Fraction that is in text form into decimal

Hi,

Am Wed, 6 Jun 2018 14:55:30 +0100 schrieb Pack:

Import data with fractions like this 44"1/16 so it reads it as text and
not number. I need a formula to turn it into decimal numbers so I can
use them in equations.


try:
=LEFT(A1,FIND("""",A1)-1)+MID(A1,FIND("""",A1)+1,FIND("/",A1)-FIND("""",A1)-1)/MID(A1,FIND("/",A1)+1,2)


Regards
Claus B.
--
Windows10
Office 2016
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,872
Default Converting Fraction that is in text form into decimal

Hi,

Am Wed, 6 Jun 2018 18:03:17 +0200 schrieb Claus Busch:

=LEFT(A1,FIND("""",A1)-1)+MID(A1,FIND("""",A1)+1,FIND("/",A1)-FIND("""",A1)-1)/MID(A1,FIND("/",A1)+1,2)


you can also try it with an UDF.
Copy the code into a standard module:

Function Deci(myRng As Range) As Double
Dim varData As Variant
Dim varTmp As Variant

varData = Split(myRng, """")
varTmp = Split(varData(1), "/")
Deci = varData(0) + varTmp(0) / varTmp(1)
End Function

and call the function on the sheet with e.g.

=Deci(A1)


Regards
Claus B.
--
Windows10
Office 2016
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fraction to Decimal Michael Dugan Excel Worksheet Functions 2 February 13th 13 03:27 AM
Fraction to decimal Alvin Excel Programming 2 April 18th 10 10:48 PM
How can I turn a fraction into a decimal. Megan Excel Worksheet Functions 0 October 15th 09 04:49 PM
formula for converting decimal to inch & fraction davepatrob Excel Discussion (Misc queries) 1 December 31st 05 03:10 PM
How do I change a text fraction. eg 1 1/2 into a decimal number, . antac Excel Worksheet Functions 1 February 28th 05 05:02 PM


All times are GMT +1. The time now is 09:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"