Welcome to the Board!
Maybe try in E1:
=eval(d1)
or:
=eval(A1&B1&C1)
Hope that helps.
This is a discussion on Convert text to Formula in Excel 2007 within the Excel Questions forums, part of the Question Forums category; Hello Forum, I need to build interactive formulas as part of a bigger table. I have come only this far ...
Hello Forum,
I need to build interactive formulas as part of a bigger table.
I have come only this far with the test model:
A1 1 (or any value)
B1 + (or any operator)
C1 2 (or any value)
D1 =1+2 as the result of ="="&A1&B1&C1 in text format
Now I want E1 to show the result. In this case a total of 3
How can I convert D1 to a formula in E1 that calculates the result and changes with any of the input values? I have spend ours on it without results . Can something this simple be that complex; PLEASE
Sebastiaan
Welcome to the Board!
Maybe try in E1:
=eval(d1)
or:
=eval(A1&B1&C1)
Hope that helps.
Always make a back up copy before trying new code, you never know what you might lose!
- Posting guidelines, forum rules and terms of use
-Try searching for your answer first, see how
- Read the FAQs
- List of BB codes
"The world suffers a lot. Not because of the violence of bad people, but because of the silence of good people!"
Pretty sure you need VBA to do that.
Here's a basic UDF to do it. May need tweaking for building complex formulas in this manner. But works for the basic example you provided.
Put this code in any standard module
Then you can use this in a cell formulaCode:Public Function Eval(myval As String) 'Evaluates a text string as A formula Eval = Evaluate(myval) End Function
=EVAL(A1&B1&C1)
Want better/faster responses to your questions?
Use Excel Jeanie to post samples of your sheet.
The more we learn, and the better we get at our trade, the easier it becomes to overlook the obvious.
Life moves pretty fast. If you don't stop and look around once in a while, you could miss it.
Ferris Bueller A.K.A. John Hughes, 1986
Ahhh. Thanks. I didn't think it was a native formula, but knew there was evaluate in vba, so figured it might be. But thanks for spotting that out.
So if you want to use my formula you will need to download the morefunc add-in.
Always make a back up copy before trying new code, you never know what you might lose!
- Posting guidelines, forum rules and terms of use
-Try searching for your answer first, see how
- Read the FAQs
- List of BB codes
"The world suffers a lot. Not because of the violence of bad people, but because of the silence of good people!"
Depending on how complex your operands can be, you could use an if statement:
=IF(B1="+",A1+C1,IF(B1="-",A1-C1,IF(B1="/",A1/C1,A1*C1)))
Always make a back up copy before trying new code, you never know what you might lose!
- Posting guidelines, forum rules and terms of use
-Try searching for your answer first, see how
- Read the FAQs
- List of BB codes
"The world suffers a lot. Not because of the violence of bad people, but because of the silence of good people!"
EVALUATE is available to Names.
(After selecting E1 per: proper relative addressing )
one could define a name Name: formulaResult RefersTo: =EVALUATE(Sheet1!$D1)
Putting =formulaResult in a cell (in row1) will then return the desired result.
Last edited by mikerickson; Feb 9th, 2010 at 10:05 AM.
The =Eval or Evaluate function looked very promising and have tried the functions standalone and in a named cell. Sad to say, neither works. They do not appear to be standard dunctions. I'll see if I can download the function somewhere.
I will try to find and download "MoreFunc Add-In" as suggested. Hope that goes smoothly. Back to GGLE..............
This is where I went:
http://www.freedownloadscenter.com/B..._Download.html
Download creates a setup file. Closed Excel, started setup, followed the instructions and SUPER. Re-started Excel and I have a whole series of new functions on the Formula ribbon. EVAL was there and worked. Problem solved.
Thank you all!
Sebastiaan
Sebastiaan
EVALUATE will not work when in a formula that is entered in a cell.
EVALUATE will work when part of the definition of a Name.
e.g. Define a name
Name: Test
RefersTo = EVALUATE("2")
then,
putting =EVALUATE("2") in a cell will return an error
putting =Test in a cell will return 2.
Hi evrybody,
Does enybody knows similiar formula that works with reference on closed workbook?
Like this thread? Share it with others