+ Reply to Thread
Results 1 to 6 of 6

Formula mixed with text

  1. #1
    Registered User
    Join Date
    01-07-2010
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2003
    Posts
    3

    Formula mixed with text

    Hi

    I would like to calculate a formula in a cell that has other text as well, for example:

    In cell A1: Hello world. 8+9

    I would like to extract the formula and calculated it, how?

    Many thanks!

    Stefan

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Formula mixed with text

    Can you give more typical examples?

    Is there a consistent pattern? I.e. Is it always at the end, etc..?
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    01-07-2010
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Formula mixed with text

    Hi, thanks for replying.

    In fact, excactly what I am doing is like this: I am pulling numbers and operators (+, -, * or /) from different cell like this:

    A1: 8
    A2: +
    A3: 9
    A4: ="="&A1&A2&A3

    The problem is that the result in cell A4 becomes =8+9 and not the actual result of the calculation 17 , which is what I am looking for. This might seem different from my original question, but basically I would like the text to be converted to a formula that could be calculated.

    Many thanks again!

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Formula mixed with text

    There is no straight function in Excel to do that, but there are ways..
    ...one of the easiest is to download and install a free addin from here: Morefunc.xll and then use formula:

    =EVAL(A1&A2&A3)

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula mixed with text

    If you're unable to install the add-in another route would be to use a UDF to mimic the morefunc function:

    Please Login or Register  to view this content.
    The above, stored in a Module, can be called from the cell using

    Please Login or Register  to view this content.
    You can also use Names in similar vein but if the construct of the formula is not consistent you may end up needing to use more cells than either of the above suggestions
    (ie construct formula in one cell and evaluate in another)

  6. #6
    Registered User
    Join Date
    01-07-2010
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Formula mixed with text

    The EVAL() formula worked great, thanks! And thanks to you too DonkeyOte for the input!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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