[Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register]

Author Message
yugi
Newbie

Joined: 23 Jul 2006
Posts: 1

 Posted: Sun Jul 23, 2006 12:02 pm    Post subject: Help please with an inverse of a formula 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!
Sliderule
Super User

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

Posted: Sun Jul 23, 2006 12:27 pm    Post subject:

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
RickRandom
Super User

Joined: 27 Jan 2006
Posts: 1082
Location: UK

 Posted: Sun Jul 23, 2006 1:17 pm    Post subject: 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?
David
Super User

Joined: 24 Oct 2003
Posts: 5668

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

 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.
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT - 8 Hours Page 1 of 1

 Jump to: Select a forum OpenOffice.org Forums----------------Setup and TroubleshootingOpenOffice.org WriterOpenOffice.org CalcOpenOffice.org ImpressOpenOffice.org DrawOpenOffice.org MathOpenOffice.org BaseOpenOffice.org Macros and APIOpenOffice.org Code Snippets Community Forums----------------General DiscussionSite Feedback
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