View Single Post
  #4   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Thu, 30 Dec 2004 13:04:03 -0800, "Renny Bosch" wrote:

In trying to use Excel to help solve a mathematical puzzle, I would like to
calculate the result of applying the mathematical operator in one cell to
the numbers in two other cells.

Example: A1 contains 2, B1 contains +, C1 contains 3. In D1, create a
formula that will give the result of 2 + 3, i.e. 5.

I have tried (among many other attempts)
=VALUE(CONCATENATE(A1, B1, C1)), but it gives me a #VALUE! error.

What am I missing?


You are missing the fact that the VALUE function does not work on strings
unless they represent a number. In other words, it does not work on formulas,
or operators (such as the '+').

Excel does not have a built in function to do what you wish.

However, if you Google for Longre, and/or morefunc.xll, you will find the
morefunc (free) add-in which contains a function called EVAL, which can convert
a formulaic string to it's result.

However, be sure that you are concatenating strings, and not a combination of
numbers and strings. So your formula would be something like:

=EVAL(CONCATENATE(TEXT(A1,"@"), B1, TEXT(C1,"@")))

or

=EVAL(TEXT(A1,"@")& B1 & TEXT(C1,"@"))


--ron