# Thread: variable (office Xp/ 2007)

1. ## variable (office Xp/ 2007)

I want to know how to use variable in excel 2007. e.g if we calculate the value like 12a + 3a = 15a. how can we write these values on excel sheet. Thankyou

2. ## Re: variable (office Xp/ 2007)

It's not quite clear to me what you want. If you perform a calculation in Visual Basic and want to store the result in a cell on a worksheet, you can use the following

Dim x As Double

' calculation goes here
...
x = ...
...
Range("B3") = x

This will store the value of x in cell B3 on the currently active worksheet. If you want to store it in a cell on another worksheet in the active workbook, use somehting like

Worksheets("Data").Range("B3") = x

And if you want to store the value in a cell on a worksheet in another open workbook, use something like

Workbooks("Test.xls").Worksheets("Data").Range("B3 ") = x

3. ## Re: variable (office Xp/ 2007)

Like Hans, I am unclear of your question. If not using VB you could define the variable as a cell and define a formula in a cell like:

=12 * A1 + 3 * A1

and when the variable A1 is changed the cell value will change

Steve

4. ## Re: variable (office Xp/ 2007)

Thankyou sir, both of you for your kind reply. ok I give you an idea about my question.
Let's assume we have salted water of different concentration. We convert it to our desired concentration. For this purpose pure concentration liquid is there. We use following formula to get desired values
C1 V1 + C2V2 = C3(V1+V2)
where C1 is the initial conc (known value)
where V 1 is the volume (known value) against conc
C2 is the conc of pure substance which should be added to achieve the desired product
V2 is the required value
C3 is the desired limit.
How can we solve it in excel thankyou

5. ## Re: variable (office Xp/ 2007)

I assume that you want to calculate the value of V2.

The attached workbook demonstrates two different approaches.

In the first, we use mathematics to backsolve the equation for V2.

In the second, we use the Goal Seek option from the Tools menu to let Excel do the work (see the instructions on the sheet).

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•