Help! cells a=1; b=2;c=3 how to make cell d=a+b*c show 1+2*3

V

vaso82

i've searched microsoft.public.excel with keywords "formula
substitute values", but haven't found the answer.
Please help if you know how to do it.
Thanks in advance!
 
V

vaso82

Thanx for quick reply but i need to have c=7 and a convinent way to
type the formula
 
M

MartinW

Hi Vaso,

As Pete says it is rather confusing as to what you want here.
As a stab in the dark it may be this,

=A1&" + "&B1&" * "&C1&" = "&A1+B1*C1

HTH
Martin
 
V

vaso82

i mean i need to have d equal to the result of a+b*c, not the string
"1+2*3"
And it's rather unconvinient to type all this ampersands and quotes.
 
P

Pete_UK

I think what you really want is:

=A1+B1*C1

in D1 - this will give you the result of 7 in D1, if you have the
values stated earlier.

Hope this helps.

Pete
 
V

vaso82

Sorry i must be dumb today, but i need both: the value of D should be
7, and the cell should show "1+2*3"
Can it be done?
 
Z

Zone

vaso,
The cell can have a formula and a value. In order for the cell's value to
be 7, it can have a formula of =A1+B1*C1 or =1+2*3, but not both! If you
want to put in the formula with the numbers for just for the one cell, you
could do it with worksheet_change event code, but you wouldn't want such
events occurring in multiple cells. Or, you could do it for multiple cells
with a standard macro, but it would not update automatically when cells A1,
B1, or C1 are changed. James
 
B

Barb Reinhardt

Press Alt F11
Insert New Module
Paste this in the module


Function FormulaIs(myCell As Range)

FormulaIs = "'" & myCell.Formula

End Function

THis ASSUMES only one cell is used in the formula.

IN aqn adgacent cell to your formula, enter

=FormulaIS(A1)

Or other appropriate reference.

You'll get the formula in A1.
 
Top