Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,388
Default Is there a function that will evaluate a text string in a cell?

Depending of the data in the spreadsheet, I need to change the formula in a
cell. I'm trying to find an excel function that will evaluate the resulting
text in a cell sort of like the INDIRECT() function does but one that will
work on formulas. I'm trying to use a formula in a cell to create a text
string that I then want evaluated. I.e.; a formula in cell A1 creates a text
string with a formula "=B2*C2". I'm looking for a function that will evaluate
that string. I thought this function was in excel but I can't find it.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Is there a function that will evaluate a text string in a cell?

Try this UDF (User Defined function). From workbook launch VBE using Alt+F11.
From menu Insert a Module and paste the below function.Close and get back to
workbook and try the below formula.

In cellD2 you have the text
=B2*C2

In cell D3 you try the formula
=eval(D2)

Function Eval(strFormula As String) As Variant
Eval = Evaluate(strFormula)
End Function

If this post helps click Yes
---------------
Jacob Skaria


"Dave" wrote:

Depending of the data in the spreadsheet, I need to change the formula in a
cell. I'm trying to find an excel function that will evaluate the resulting
text in a cell sort of like the INDIRECT() function does but one that will
work on formulas. I'm trying to use a formula in a cell to create a text
string that I then want evaluated. I.e.; a formula in cell A1 creates a text
string with a formula "=B2*C2". I'm looking for a function that will evaluate
that string. I thought this function was in excel but I can't find it.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default Is there a function that will evaluate a text string in a cell?

Hi,

Click on cell A1 and then go to Insert Name Define. Give it a name
called array. In the formula, enter =EVALUATE(Sheet1!$A$1). in A2, enter
=sum(array).

Hope this helps.

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"Dave" wrote in message
...
Depending of the data in the spreadsheet, I need to change the formula in
a
cell. I'm trying to find an excel function that will evaluate the
resulting
text in a cell sort of like the INDIRECT() function does but one that will
work on formulas. I'm trying to use a formula in a cell to create a text
string that I then want evaluated. I.e.; a formula in cell A1 creates a
text
string with a formula "=B2*C2". I'm looking for a function that will
evaluate
that string. I thought this function was in excel but I can't find it.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Function to evaluate function as string Basil Excel Worksheet Functions 3 September 18th 09 10:43 AM
Evaluate text string as a function benb Excel Discussion (Misc queries) 3 July 19th 06 02:41 PM
IF function - need to evaluate cell content in 2 separate files-#N PBM Excel Worksheet Functions 3 July 5th 05 08:17 AM
Evaluate string as a formula peacelittleone Excel Worksheet Functions 3 June 26th 05 06:20 PM
how to evaluate the content of a string as if it was a formula cyrille de brébisson Excel Discussion (Misc queries) 5 December 6th 04 10:47 PM


All times are GMT +1. The time now is 02:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"