ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   converting fractions to decimal (https://www.excelbanter.com/excel-discussion-misc-queries/32049-converting-fractions-decimal.html)

PDI-AV

converting fractions to decimal
 
As a data entry tool in an Excel form, I'd like to convert a numeric fraction
("3/4") contained in a "source cell" to its decimal equivalent ("0.75")
contained in a corresponding "target cell". The target cell needs to
dynamically react to any changes in the source cell (using formulas and
text-to-column delivers the correct result, but it is not dynamic). Is this
possible? How?

Jim Cone

It appears, after a little experimenting ,that
entering the fraction as a fraction: 0 3/4
or
number formatting the fraction as a fraction
allows the dependent cell to display decimals,
if the dependent cell is formatted as a number.

Jim Cone
San Francisco, USA


"PDI-AV" wrote in message
...
As a data entry tool in an Excel form, I'd like to convert a numeric fraction
("3/4") contained in a "source cell" to its decimal equivalent ("0.75")
contained in a corresponding "target cell". The target cell needs to
dynamically react to any changes in the source cell (using formulas and
text-to-column delivers the correct result, but it is not dynamic). Is this
possible? How?

Biff

Hi!

Assume A1 holds the fractional value. Cell A1 would have to be formatted as
TEXT, otherwise Excel will interpret 3/4 as a date.

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

Biff

"PDI-AV" wrote in message
...
As a data entry tool in an Excel form, I'd like to convert a numeric
fraction
("3/4") contained in a "source cell" to its decimal equivalent ("0.75")
contained in a corresponding "target cell". The target cell needs to
dynamically react to any changes in the source cell (using formulas and
text-to-column delivers the correct result, but it is not dynamic). Is
this
possible? How?




PDI-AV

Very,very cool! I'll spend a few minutes dissecting this expression (to
completely understand it), but you have to admire the result! Many thanks!

"Biff" wrote:

Hi!

Assume A1 holds the fractional value. Cell A1 would have to be formatted as
TEXT, otherwise Excel will interpret 3/4 as a date.

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

Biff

"PDI-AV" wrote in message
...
As a data entry tool in an Excel form, I'd like to convert a numeric
fraction
("3/4") contained in a "source cell" to its decimal equivalent ("0.75")
contained in a corresponding "target cell". The target cell needs to
dynamically react to any changes in the source cell (using formulas and
text-to-column delivers the correct result, but it is not dynamic). Is
this
possible? How?





PDI-AV

OK, here's the next layer of complexity (for me)...given that the resulting
decimal value in the target cell is used in other formulas, a valid number is
required in this target cell as to preclude an error condition in the
dependent formulas. When the source cell (containing the original fraction)
is blank, this otherwise cool fraction-to-decimal formula delivers a
non-numeric value in the target cell ("#VALUE!"). How can I condition the
target cell to defaut to a zero value in this instance?

"Biff" wrote:

Hi!

Assume A1 holds the fractional value. Cell A1 would have to be formatted as
TEXT, otherwise Excel will interpret 3/4 as a date.

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

Biff

"PDI-AV" wrote in message
...
As a data entry tool in an Excel form, I'd like to convert a numeric
fraction
("3/4") contained in a "source cell" to its decimal equivalent ("0.75")
contained in a corresponding "target cell". The target cell needs to
dynamically react to any changes in the source cell (using formulas and
text-to-column delivers the correct result, but it is not dynamic). Is
this
possible? How?





Biff

Hi!

Try one of these:

=IF(A1="",0,LEFT(A1,FIND("/",A1)-1)/MID(A1,FIND("/",A1)+1,255))

=IF(ISERROR(LEFT(A1,FIND("/",A1)-1)/MID(A1,FIND("/",A1)+1,255)),0,LEFT(A1,FIND("/",A1)-1)/MID(A1,FIND("/",A1)+1,255))

Biff

"PDI-AV" wrote in message
...
OK, here's the next layer of complexity (for me)...given that the
resulting
decimal value in the target cell is used in other formulas, a valid number
is
required in this target cell as to preclude an error condition in the
dependent formulas. When the source cell (containing the original
fraction)
is blank, this otherwise cool fraction-to-decimal formula delivers a
non-numeric value in the target cell ("#VALUE!"). How can I condition the
target cell to defaut to a zero value in this instance?

"Biff" wrote:

Hi!

Assume A1 holds the fractional value. Cell A1 would have to be formatted
as
TEXT, otherwise Excel will interpret 3/4 as a date.

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

Biff

"PDI-AV" wrote in message
...
As a data entry tool in an Excel form, I'd like to convert a numeric
fraction
("3/4") contained in a "source cell" to its decimal equivalent ("0.75")
contained in a corresponding "target cell". The target cell needs to
dynamically react to any changes in the source cell (using formulas and
text-to-column delivers the correct result, but it is not dynamic). Is
this
possible? How?








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

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