Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default fractions to decimal

I want to have one cell call a cell that has a fraction in it that is
formated like so
0'-7/8"
I need it to be formated like
0'-0 7/8" so with the following code I can convert it to decimal.

[=SUBSTITUTE(LEFT(H69,FIND("-",H69)-1),"'","")*12+SUBSTITUTE(REPLACE(H69,1,FIND("-",H69),""),"""","")]

the above code works when it is formated correctly

Please help
Thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 395
Default fractions to decimal

Is this a custom cell format, or just content stored as the text default?

if text, why not just search/replace "-" with "- 0 "

Or if you have mixed cells (you didn't provide much detail), use code to
find cells where [logic, not code] =Len
((find("/",string))-(find("-",string)))< 3
and just replace in those cells

HTH
Keith


"Alvin" wrote:

I want to have one cell call a cell that has a fraction in it that is
formated like so
0'-7/8"
I need it to be formated like
0'-0 7/8" so with the following code I can convert it to decimal.

[=SUBSTITUTE(LEFT(H69,FIND("-",H69)-1),"'","")*12+SUBSTITUTE(REPLACE(H69,1,FIND("-",H69),""),"""","")]

the above code works when it is formated correctly

Please help
Thanks in advance

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
Converting decimal fractions of minutes to seconds ronnie-g Excel Worksheet Functions 13 April 22nd 23 10:08 AM
Convert decimal to fractions Eamon Excel Worksheet Functions 3 October 20th 06 04:09 PM
excel conditional formating decimal fractions Andy Dixon Excel Worksheet Functions 6 April 17th 06 10:25 PM
converting fractions to decimal PDI-AV Excel Discussion (Misc queries) 5 June 25th 05 03:43 AM
How do I convert decimal inches to fractions in excel JTZ Excel Discussion (Misc queries) 2 February 7th 05 09:31 PM


All times are GMT +1. The time now is 07:05 AM.

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"