+ Reply to Thread
Results 1 to 3 of 3

Is it possible to use formulas indirectly based on text?

  1. #1
    Registered User
    Join Date
    04-16-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    52

    Question Is it possible to use formulas indirectly based on text?

    Let's say in the value of A1 = "SUM(2, 4)/2". I would like to put a formula in another cell which would evaluate this text with an "=" in the front.

    Let's say the function I'm looking for is in A2. In this case the value in A2 is supposed to be 3, however if the value of A1 changes to "SUM(2, 4)/2+1" the value of A2 is supposed to change to 4.

    I could do this with a macro but it would be more convenient if it was possible to do with a function.
    Last edited by tahi.laci; 12-31-2013 at 11:13 AM.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Is it possible to use formulas indirectly based on text?

    You could use an ancient Excel4 macro command, instead of VBA.
    A1: SUM(2,4)/2

    • Formulas.Name_Manager...click: New
    ...Name: MyCalcVal
    ...Refers to: =EVALUATE(Sheet1!$A$1)
    ...Click: OK

    Next...
    A2: =MyCalcVal
    The result will be: 3

    Is that any approach you could use?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    04-16-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    52

    Re: Is it possible to use formulas indirectly based on text?

    I didn't fully understand your answer, however after some search I found out that the EVALUATE function can be part of a user defined function like this
    Please Login or Register  to view this content.
    With that in place I put A2: "=eval(A1)" and my problem is solved. , Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Populate a Cell with text based on the result of 2 seperate formulas
    By Medwards73 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2012, 08:56 AM
  2. [SOLVED] Indirectly Referencing Another Workbook
    By RogueArchon in forum Excel General
    Replies: 5
    Last Post: 07-20-2012, 03:51 PM
  3. Execute a formula Indirectly
    By TomTheTrader in forum Excel General
    Replies: 2
    Last Post: 01-22-2008, 08:01 AM
  4. refer indirectly to Name
    By Hershmab in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-24-2006, 12:35 PM
  5. Replies: 5
    Last Post: 10-26-2005, 03:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1