I have an excel sheet containing following data pattern.

|date           |expenses           |total |

| 01/03/2014    |50 + 100 +10 + 50  |210   |

ie date, expenses and total are heading and others are the corresponding data. In this sheet I need to calculate the sum of 'expenses' column, that I need display in 'total' column. Is there is any formula like =sum(B2).

有帮助吗?

解决方案

You can use this simple UDF:

Function eval(expr As String)
    eval = Evaluate(expr)
End Function

and call it like this: =eval(B2).

Note, that length of the expr must be less than or equal to 255 characters.

enter image description here

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top