ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Convert fraction to decimal (https://www.excelbanter.com/excel-discussion-misc-queries/147039-convert-fraction-decimal.html)

Dig

Convert fraction to decimal
 
Is there anyway in Excel to format a cell so if the user types 61/4 it will
convert to 6.25? If not what is the best way to create a conversion so the
user can type in 51/2 and have 5.5 show up, either in another cell or in the
same cell?

Thanks for the help

Gary''s Student

Convert fraction to decimal
 
In a separate cell enter:
=LEFT(A1,1)+MID(A1,2,1)/RIGHT(A1,1)

This works for very simple cases, but if you have something like:

111/25

we can't tell if its
11 & 1/25
or
1 & 11/25
--
Gary''s Student - gsnu200731


"Dig" wrote:

Is there anyway in Excel to format a cell so if the user types 61/4 it will
convert to 6.25? If not what is the best way to create a conversion so the
user can type in 51/2 and have 5.5 show up, either in another cell or in the
same cell?

Thanks for the help


Earl Kiosterud

Convert fraction to decimal
 
Dig,

One possibility is to first format the cell as a number, such as with Format - Cells -
Number - Number. Now the automatic formatting to fraction number formatting when the user
types 6 1/4 won't occur. The problem is that you'll get fixed decimal place, unlike
General. We all wish we could disable automatic formatting for cells. We think they're
going to do that in 2057.

If that isn't satisfactory, an event-fired macro could automatically reformat it after the
user types in the 6 1/4.
--
Earl Kiosterud
www.smokeylake.com

Note: Top-posting has been the norm here.
Some folks prefer bottom-posting.
But if you bottom-post to a reply that's
already top-posted, the thread gets messy.
When in Rome...
-----------------------------------------------------------------------
"Dig" wrote in message
...
Is there anyway in Excel to format a cell so if the user types 61/4 it will
convert to 6.25? If not what is the best way to create a conversion so the
user can type in 51/2 and have 5.5 show up, either in another cell or in the
same cell?

Thanks for the help




Lori

Convert fraction to decimal
 
Maybe use a custom format that returns the same as General e.g.

General;-General

so that it doesn't autoformat to a fraction format.

On 19 Jun, 17:18, "Earl Kiosterud" wrote:
Dig,

One possibility is to first format the cell as a number, such as with Format - Cells -
Number - Number. Now the automatic formatting to fraction number formatting when the user
types 6 1/4 won't occur. The problem is that you'll get fixed decimal place, unlike
General. We all wish we could disable automatic formatting for cells. We think they're
going to do that in 2057.

If that isn't satisfactory, an event-fired macro could automatically reformat it after the
user types in the 6 1/4.
--
Earl Kiosterudwww.smokeylake.com

Note: Top-posting has been the norm here.
Some folks prefer bottom-posting.
But if you bottom-post to a reply that's
already top-posted, the thread gets messy.
When in Rome...
-----------------------------------------------------------------------"Dig" wrote in message

...



Is there anyway in Excel to format a cell so if the user types 61/4 it will
convert to 6.25? If not what is the best way to create a conversion so the
user can type in 51/2 and have 5.5 show up, either in another cell or in the
same cell?


Thanks for the help- Hide quoted text -


- Show quoted text -





All times are GMT +1. The time now is 08:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com