Home » excel » excel – Automatically sum manually typed equation in another cell

excel – Automatically sum manually typed equation in another cell

Posted by: admin May 14, 2020 Leave a comment

Questions:

I just wanted to know that I have some values written in Cell J10 as shown in image and want to sum these values in cell K10 cell.

To do so, I currently add them manually by typing =1.25+1.25-1+.5 in cell K10.

Is there any way that cell K10 automatically calculates the values entered in cell J10 as shown in image, and cell K10 automatically updates the total if I make any changes in values in cell J10?

enter image description here

enter image description here

How to&Answers:

I’ll assume you want to type the formula into J10 and have the result in K10 (per your narrative and image).

enter image description here

Go to Formulas, Defined Names, Name Manager and click New. Set up a new named range called evalJ with workbook scope and a Refers to: of,

=evaluate(column!$J1)

Click OK to create the name and exit the Name Manager.

Type your formula into J10 (e.g. 1.25+1.25-1+.5) without an equals sign. Put the following formula into K10,

=iferror(evalJ, "")

This can be used in any column to evaluate an equation in column J of the same row.

enter image description here

Answer:

Use the following UDF

Function mySum(s As String) As Variant
 mySum = Evaluate(s)
End Function