ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Adding a Number and Formula Text and Evaluating (https://www.excelbanter.com/excel-worksheet-functions/193345-adding-number-formula-text-evaluating.html)

obrien234

Adding a Number and Formula Text and Evaluating
 
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

Gord Dibben

Adding a Number and Formula Text and Evaluating
 
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


On Tue, 1 Jul 2008 12:10:01 -0700, obrien234
wrote:

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




All times are GMT +1. The time now is 09:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com