Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Formula containing Value and Cell

Status
Not open for further replies.

senators40

Technical User
Jan 7, 2003
68
CA
Hi,

I have a cell in column A1 for 100

Cell C1 formula should be =A1+B1

However I would like it to be the value in cell A1 + the formula in B1

So the formula would be =100 + B1

If A1 were 150 the formula would be =150 + B1

Unfortunately the amount in A1 varies

Any help would be appreciated.

Thanks,

Jeff
 
As you asked in the VBA forum, here a VBA starting point:
Code:
Range("C1").Formula = "=" & Range("A1") & "+B1"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 



Hi,

Why would this not work ON THE SHEET?
[tt]
=A1+B1
[/tt]
What you stated, "However I would like it to be the value in cell A1 + the formula in B1," and your supporting example, "=100 + B1" is not consistent. =B1 returns the VALUE in B1, and NOT THE FORMULA in B1!!!

So =A1+B1, returns the VALUE in A1 plus the VALUE in B1. Nowhere is the FORMULA returned!.

If A1 ia 100, then THAT is what is used in the calculation.

If A1 is 150, then THAT is what is used in the calculation.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Thanks for the response. It worked very well

In my real scenario the amount in cell A1 is a result of another formula in another row, which may be sorted, moved or deleted so I wanted the number of whatever was in cell A1 and then add another number in another cell.

Thanks,

Jeff
 



"the amount in cell A1 is a result of another formula in another row, "

SO WHAT! It's the VALUE that is worked on, regardless of how it got there.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top