ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   equation as text string and its numeric result (https://www.excelbanter.com/excel-discussion-misc-queries/141555-equation-text-string-its-numeric-result.html)

patryk

equation as text string and its numeric result
 
How can I type an equation in one cell as a text string eg. "2+3+(5+6)*6"
and get its result in the other one?

Pete_UK

equation as text string and its numeric result
 
Do a search of the newsgroups looking for Eval - you can define a User-
defined Function making use of Evaluate to do this.

Hope this helps.

Pete

On May 4, 11:01 am, patryk wrote:
How can I type an equation in one cell as a text string eg. "2+3+(5+6)*6"
and get its result in the other one?




Gary''s Student

equation as text string and its numeric result
 
Try this tiny UDF:

Function value_of(r As Range) As Variant
value_of = Evaluate("=" & r.Value)
End Function

--
Gary''s Student - gsnu200718


All times are GMT +1. The time now is 08:58 AM.

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