Math equations in Excel - HotUKDeals
We use cookie files to improve site functionality and personalisation. By continuing to use HotUKDeals, you accept our cookie and privacy policy.
Get the HotUKDeals app free at Google Play

Search Error

An error occurred when searching, please try again!

Login / Sign UpSubmit

Math equations in Excel

£0.00 @
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.… Read More
James... Avatar
7y, 6m agoPosted 7 years, 6 months ago
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
James... Avatar
7y, 6m agoPosted 7 years, 6 months ago
Options

All Comments

(10) Jump to unreadPost a comment
Comments/page:
#1
I wish i knew what the hell you were talking about :?
banned#2
yeah

just put a value in cell A1

and put this formula in A2

=SUM(A1^2 + 2*A1 +1)
banned 1 Like #3
value in a1 of 3 calculated 16

value in a1 of 5 calculated 36

seems ok
#4
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
#5
James...
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://static.toodoc.com/download.php?s=YTo0OntzOjM6InVybCI7czo1ODoiaHR0cDovL3d3dy5jc3VzLmVkdS9pbmRpdi9uL25ndy9FRUUtMjQ0L25vdGUvQmlzZWN0aW9uLnhscyI7czo0OiJzaXplIjtzOjU6IjQ3MTA0IjtzOjQ6ImRhdGUiO3M6MTA6IjIwMDgvMDIvMTIiO3M6NToidGl0bGUiO3M6OToiQmlzZWN0aW9uIjt9 I can't tell as I don't have excel on my laptop.
#6
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.
1 Like #7
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 >Tools<>Goal 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 http://library.thinkquest.org/20991/alg2/quad.html
or http://en.wikipedia.org/wiki/Quadratic_equation
#8
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
#9
http://i31.photobucket.com/albums/c379/jamesmal/zzzzzzz.png
#10
Is it only showing up small on mine? The actual image is full screen size?

Post a Comment

You don't need an account to leave a comment. Just enter your email address. We'll keep it private.

...OR log in with your social account

...OR comment using your social account

Thanks for your comment! Keep it up!
We just need to have a quick look and it will be live soon.
The community is happy to hear your opinion! Keep contributing!