Adding a Number and Formula Text and Evaluating

O

obrien234

I have two separate cells. One is a number, for example cell B1 with a value
of 0.109. The other, B2, is in the format "* A1". I'm trying to combine the
two cells so they will display the value of "0.109 * A1", where A1 is a
reference to the cell A1. I've copied these cells from another program and
Excel does not seem to recognize that the text "* A1" works in a formula.
I've tried using a formula like

B1&B2
or
B1+B2

but the formatting is not correct and excel just displays the function
without evaluating it to the number it should represent. Any suggestions?

thank you
 
G

Gord Dibben

Use this UDF which you would copy to a general module in your workbook.

Function EvalCell(RefCell As String)
Application.Volatile
EvalCell = Evaluate(RefCell)
End Function

With 0.109 in B1 and 100 in A1 and * A1 in C1 enter in D1

=EvalCell(B1 & C1) return 10.9


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top