Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Jul 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    variable (office Xp/ 2007)

    Respected Sir/Madam
    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. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    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. #3
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    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. #4
    New Lounger
    Join Date
    Jul 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    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).
    Attached Files Attached Files

Posting Permissions

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