+ Reply to Thread
Results 1 to 8 of 8

Solve equation

  1. #1
    Registered User
    Join Date
    08-19-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    4

    Solve equation

    Could anyone please help me how can I solve the following equation:

    C=x* ln(x/B)

    eg. 28.42= x * ln( x/84) should give me a value of x as 109

    here C & B are constants.

    I need to find x. Solver is giving an error.

    I use Excel 2010

    Many thanks in advance!!!

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Solve equation

    With
    A1: = B1* LN(B1/84)
    B1: a seed value to start with....100

    Data.What-if-Analysis...Goal Seek
    ...Set cell: A1
    ...To value: 28.42
    ...by changing cell: B1
    ...Click: OK

    Does that help?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Solve equation

    Solver works fine for me, what solver settings are you using?

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Solve equation

    Can you specify what error Solver is giving you?

    Rather than just give you the solution, let's talk a little about how to solve these.

    1) Solver's default is to use the Newton Raphson method to find the roots to these kinds of equations. If you are unfamiliar with how the NR algorithm works, I would suggest you spend some time becoming familiar with it. Wikipedia has a good discussion, even if it tends to be a very technical. I like this page from the University of Utah that has a nice little applet for exploring the behavior of the NR algorithm with several different problems.

    2) One of the first things I usually do with a problem like this is create a table of values to show C as a function of x. Maybe something like (comma delimited):
    Please Login or Register  to view this content.
    Then plot on a scatter plot. Then I can observe the behavior of the function and graphically visualize what it is doing. Do this for several values of B to see how B effects the function.

    3) A most useful part of doing part 2 is that, once I have an overall picture of how this function behaves, it becomes easier to select an initial guess for x (the tutorial above should have shown how important initial guess is to the NR algorithm). This function is fairly simple, I would expect that Solver should have no problem finding the solution once you give it a suitable initial guess.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    Registered User
    Join Date
    08-19-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Solve equation

    Many thanks. Tried the goal seek formula which works perfectly for the above example. However 28.42 is not a fixed number and is an outcome of calculations and will change for other scenarios. Can i reference the "to value" in goal seek to a cell. is there another method of solving this such that the values of C & B changes reference to another excel cell.

  6. #6
    Registered User
    Join Date
    08-19-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Solve equation

    Which settings need to be used? It says-"Solver encountered an error in the objective cell" Please help!

  7. #7
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Solve equation

    However 28.42 is not a fixed number and is an outcome of calculations and will change for other scenarios. Can i reference the "to value" in goal seek to a cell.
    You cannot directly reference a cell in the target value field in Goal Seek/Solver. The way I would do it is to add a helper cell that is simply "Set cell"-"target value". Then have Solver/Goal seek set helper cell to a value of 0 by changing x.

    It says-"Solver encountered an error in the objective cell" Please help!
    Gut feel is that this error is ultimately because you chose a bad initial guess (what Ron called a seed value). I will suggest again that you review the tutorial I suggested so that you understand how the NR algorithm works. For this problem, it is necessary to select an initial guess that is on the right side of the function minimum. If your initial guess is on the wrong side of the function minimum, then the NR algorithm will naturally try a negative value for x, and Excel cannot take the ln() of a negative value, and, thus you get an error. To make this spreadsheet more robust, it might even be worthwhile to spend some time with the function (plotting the function at several different values of x as I suggested would be a good start). There should be a way to have Excel calculate a good initial guess (perhaps by locating the minimum and selecting some value for x larger than that).

  8. #8
    Registered User
    Join Date
    08-19-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    4

    Wink Re: Solve equation

    [QUOTE=MrShorty;3373338]You cannot directly reference a cell in the target value field in Goal Seek/Solver. The way I would do it is to add a helper cell that is simply "Set cell"-"target value". Then have Solver/Goal seek set helper cell to a value of 0 by changing x.

    Many Thanks!!!! Worked!!! Thankyou thankyou!!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to solve this equation in Excel?
    By ripper_sweden in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 07-04-2013, 12:40 PM
  2. To solve equation in excel
    By Salimmulla in forum Excel General
    Replies: 2
    Last Post: 02-02-2011, 05:18 AM
  3. Solve this Equation, Please
    By Barbara Harris in forum Excel General
    Replies: 2
    Last Post: 02-23-2006, 01:45 PM
  4. How do I could solve a equation
    By Joe Satriani in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-23-2006, 08:45 AM
  5. How to solve the equation in excel using exp(x)
    By Soczeq in forum Excel General
    Replies: 1
    Last Post: 03-23-2005, 08:26 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1