1

In my MS excel spread sheet there are two columns Data and Result (as shown) . In the first row, data has value 10+20 and in result I want the value as 30. Similarly for the next rows also.

How can I achieve this using excel formula or any other means ?

enter image description here

  • cross-site duplicates: [Excel function that evaluates a string as if it were a formula?](https://superuser.com/q/253353/241386), [Excel VBA evaluate string from cell as formula with a variable](https://superuser.com/q/1280814/241386) – phuclv Dec 26 '19 at 11:52
  • Does this answer your question? [How to turn a string formula into a "real" formula](https://stackoverflow.com/questions/4471884/how-to-turn-a-string-formula-into-a-real-formula) – phuclv Dec 26 '19 at 11:52

2 Answers2

1

The below formula works on the example you have provided. However, it won't work if you have more than 2 values to sum.

=IF(ISNUMBER(FIND("+",A1)),VALUE(MID(A1,1,FIND("+",A1)-1))+VALUE(MID(A1,FIND("+",A1),100)),"")

If you need a more compatible solution, you will have to use VBA User-Defined function. UDF works in almost all the scenarios and easy to apply. Add the below code in the VBA module and call the function directly from excel as shown in the screenshot.

Function EvaluateCell(Cell As Range)
    EvaluateCell = Evaluate("=" & Cell)
End Function

Example ScreenShot

manoj0790
  • 473
  • 4
  • 10
-2

Step 1: Create new formula in excel like this:

enter image description here

Step 2: Use this formula in excel.

enter image description here

NOTE : Save the excel with .xlsm extension (macro enabled).

Reference link :http://www.myonlinetraininghub.com/excel-factor-12-secret-evaluate-function.

Taran
  • 27
  • 5