Groups

    Math equations in Excel

    If I am programming some methods on finding roots of equations using excel and was wondering if there was a way to do it so I didnt have to write an equation out each time and reprogram all the cells.

    What I mean is....

    If I have the equation x^2 + 2x +1 = 0

    Can I put x^2 + 2x +1 into a cell and as the value of x changes, let it do it automatically?

    As in if I have x = 3 and I put 3 in cell A1

    can I program another cell to = x^2 + 2x +1 where x = A1 or something along those lines so it will sub in whatever calue I put in A1 without me having to change the equation?

    Cheers
    James

    Cheers
    james

    10 Comments

    I wish i knew what the hell you were talking about :?

    Banned

    yeah

    just put a value in cell A1

    and put this formula in A2

    =SUM(A1^2 + 2*A1 +1)

    Banned

    value in a1 of 3 calculated 16

    value in a1 of 5 calculated 36

    seems ok

    Original Poster

    I've got that, but its different how I need it, should have explained better.

    The x value will change alot, so I wanted sort of and absolute equation which will input different values.

    What I am actually doing is interval bisection so it puts say, 3 through, then 4 through and checks if one is positive and one is negative. If so, it will then put 3.5 through and check is the sign (plus or minus) changes between 3 and 3.5 or 3.5 and 4. Whichever it is will then be divided again, eg check 3 and 3.25 and 3.25 and 3.5.

    And if I change the initial 3 and 4, the rest will change too, so I would have to input loads for each time it checks if you catch my drift.

    Also, if I change the equation at all I would love it to be able to put x through without having to change the formulas in each cell and only one if possible.

    Reps for the help though. Thanks

    James...;6869589

    I've got that, but its different how I need it, should have explained … I've got that, but its different how I need it, should have explained better.The x value will change alot, so I wanted sort of and absolute equation which will input different values.What I am actually doing is interval bisection so it puts say, 3 through, then 4 through and checks if one is positive and one is negative. If so, it will then put 3.5 through and check is the sign (plus or minus) changes between 3 and 3.5 or 3.5 and 4. Whichever it is will then be divided again, eg check 3 and 3.25 and 3.25 and 3.5.And if I change the initial 3 and 4, the rest will change too, so I would have to input loads for each time it checks if you catch my drift.Also, if I change the equation at all I would love it to be able to put x through without having to change the formulas in each cell and only one if possible.Reps for the help though. Thanks



    Is this useful? ]http//st…jt9 I can't tell as I don't have excel on my laptop.

    I don't totally understnad what you're after, that is, I guess you're saying that just doing the math using the cell names, then pulling down so that it changes A1 to A2 then A3 etc. isn't good enough. if you need to have a place holder that the value of which keeps changing then if you can do it directly in excel you can do it in vbscript by creating a macro then just storing your answers in a variable.

    It looks like you are trying to find the number for x which will give you zero as the result o fthe equation.

    You could use Excel's goal seeking to do that.

    Put your equation in cell B1, but use A1 instead of X so you can enter a value in A1.

    For the equation you are using, B1 will contain " =A1^2+2*A1+1 "

    Go to >ToolsGoal Seek
    [INDENT]In "Set Cell" put B1

    In "To Value" put 0

    In "By Changing Cell" put A1

    Click OK[/INDENT]

    Excel will successively calculate and get as close to zero as it can (Probably .000 something).

    Repeat as required for other calculations.

    If you are just trying to solve quadratic equations, why not just use the old formula:

    See library.thinkquest.org/209…tml
    or en.wikipedia.org/wik…ion

    Original Poster

    It's easy enough to find the roots of all the equations using formula or other methods, this is just on way to find approxamations we had to learn along with a few others. so I don't want to solve it exactly for zero.Also I wouldnt mind looking at how accuracy changes if I make values more precise which it will allow me to look at quickly and easily.

    Will let me check my own answers and was just interested really if I could program it, its easy to do but the way I have done it takes ages so just wondered if I could do it a better way. It will help me program my differential equation eolver better too along with Linear Interpolation and the Newton Raphson method as well.

    Not sure what a place holder is so I will look it up. will look at the links given too thanks.

    This is what I'm trying to achieve hopefully, although it wont be setup like this, just to give you all an idea...

    http://i31.photobucket.com/albums/c379/jamesmal/excelequations.png

    Original Poster

    http://i31.photobucket.com/albums/c379/jamesmal/zzzzzzz.png

    Original Poster

    Is it only showing up small on mine? The actual image is full screen size?
    Post a comment
    Avatar
    @
      Text
      Top Discussions
      1. U.S. bombers fly off North Korea's coast in show of force2644
      2. Whoops SNP...Grenfell style cladding all over Glasgow1027
      3. Just heard this...2 ★★★★★★★★★★★★★★ congrats to all on 392k ★★★★★★★★★★★★★★7767421
      4. One for the mathmeticians1624

      See more discussions