OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Help please with an inverse of a formula

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
yugi
Newbie
Newbie


Joined: 23 Jul 2006
Posts: 1

PostPosted: Sun Jul 23, 2006 12:02 pm    Post subject: Help please with an inverse of a formula Reply with quote

Hello.

The formula to start with is A = L + (2*S) + Floor(S/10;1)^2.

What I'm trying to figure out is how to make a formula that solves for S when given values for L and A.

This is actually my first time using Calc or any spreadsheet... I'm more of a programmer so my line of thinking is something like, in psuedocode:

S=0
while(L + (2*S) + Floor(S/10;1)^2 != A)
S+1

Any suggestions on how I can do this in Calc or on other ways of tackling this problem? Thank you very much!
Back to top
View user's profile Send private message
Sliderule
Super User
Super User


Joined: 29 May 2004
Posts: 2474
Location: 3rd Rock From The Sun

PostPosted: Sun Jul 23, 2006 12:27 pm    Post subject: Reply with quote

yugi:

Within Calc ( and most other Spreadsheets too ) . . . there is a tool called: Goal Seek. You could check out the help to see an example.

To quote from the help file:

Quote:
With the help of Goal Seek you can calculate a value that, as part of a formula, leads to the result you specify for the formula. You thus define the formula with several fixed values and one variable value and the result of the formula.

To get to
Goal Seek in Calc . . . from the Menu: Tools -> Goal Seek...

I hope this helps, please be sure to let me / us know.

Sliderule
Back to top
View user's profile Send private message
RickRandom
Super User
Super User


Joined: 27 Jan 2006
Posts: 1082
Location: UK

PostPosted: Sun Jul 23, 2006 1:17 pm    Post subject: Reply with quote

Can you solve it on paper, e.g. by rearranging the formula?

If you didn't have the FLOOR() function, then it would be a quadratic, and thus easy to solve, and with 2 possible answers:

= (-2 +sqrt(2^2-4*1/100*(L-A))/(2*1/100)

and

= (-2 -sqrt(2^2-4*1/100*(L-A))/(2*1/100)

or something like that, putting the cell references for A and L in place of A and L in the above equations.

If the FLOOR() is criticla, that prevents that idea....I'm not sure how you'd solve it on paper, so perhaps the goal seek is the best solution. Remember that if you change A or L, you need to re-run the goal seek. If you've got lots of values for A and L then that's a lot of goal seeking.

If the FLOOR() function critical, or just some means to always use the next lowest integer?

Is S an integer?

What is the context?
Back to top
View user's profile Send private message
David
Super User
Super User


Joined: 24 Oct 2003
Posts: 5668
Location: Canada

PostPosted: Sun Jul 23, 2006 7:11 pm    Post subject: Re: Help please with an inverse of a formula Reply with quote

yugi wrote:
Hello.

The formula to start with is A = L + (2*S) + Floor(S/10;1)^2.

What I'm trying to figure out is how to make a formula that solves for S when given values for L and A.


Problem: Why use Floor(S/10;1)^2 which will give an error for negative values, and simply the value of S/10 for positive values ...assuming cell names, not algebraic variables?

IF you had something like A = L + (2*S) + (S/10)^2 you would have a chance using the quadratic formula [using cell names, rather than A, L of course.]


A spreadsheet is not a symbolic algebra program.

David.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group