ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   evaluating text as if it were a formula (https://www.excelbanter.com/excel-discussion-misc-queries/175081-evaluating-text-if-were-formula.html)

Peter Facey

evaluating text as if it were a formula
 
Suppose I have text in cell A3 such as "2+1/4". I want Excel 2003 to evaluate
that as a formula and put the resulting value - namely 2.25 - in another
cell. Can it do this?

I have a vague memory, perhaps of another spread sheet, that one could
say =EVAL(A3), but Excel doesn't seem to have the capability.

Roger Govier[_3_]

evaluating text as if it were a formula
 
Hi Peter

The Evaluate function is not available directly within a worksheet.
You can get around this by creating a named formula.
InsertNameDefine Name Eval Refers to =Evaluate($A1)

Enter your 2+1/4 in cell A1 and in B1 enter =EVAL and you will see the
result 2.25

The name doesn't have to be Eval, it can be anything.
The reference column can be any column, but be sure to use the $ sign to
make the column absolute
Then the formula =Eval entered into any column on your sheet will Evaluate
the contents of that same row in whichever you have set to be the Reference
column.

--

Regards
Roger Govier

"Peter Facey" wrote in message
...
Suppose I have text in cell A3 such as "2+1/4". I want Excel 2003 to
evaluate
that as a formula and put the resulting value - namely 2.25 - in another
cell. Can it do this?

I have a vague memory, perhaps of another spread sheet, that one could
say =EVAL(A3), but Excel doesn't seem to have the capability.



Gord Dibben

evaluating text as if it were a formula
 
Perhaps you had a UDF in the past.

Function EvalCell(RefCell As String)
Application.Volatile
EvalCell = Evaluate(RefCell)
End Function

=EvalCell(A1) with 2+1/4 in A1 returns 2.25


Gord Dibben MS Excel MVP


On Thu, 31 Jan 2008 02:24:01 -0800, Peter Facey
wrote:

Suppose I have text in cell A3 such as "2+1/4". I want Excel 2003 to evaluate
that as a formula and put the resulting value - namely 2.25 - in another
cell. Can it do this?

I have a vague memory, perhaps of another spread sheet, that one could
say =EVAL(A3), but Excel doesn't seem to have the capability.




All times are GMT +1. The time now is 10:02 PM.

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