+ Reply to Thread
Results 1 to 2 of 2

solving equations

  1. #1
    Registered User
    Join Date
    03-03-2013
    Location
    alep
    MS-Off Ver
    Excel 2010
    Posts
    1

    solving equations

    Hi all ...
    I need to know how I can solve an equation using excel macro
    The equation is complex and have so much constants related to textboxes and cells .... and I will give a simple example
    I have known values in column C and I need the values of Variable x
    Please Login or Register  to view this content.

    I wish your advice and thanks anyway ....

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

    Re: solving equations

    I find that it is important to understand the math behind a problem before putting it into Excel. The equation is y=x(x-sin(x)), and we are trying to find the values for x at known y's. In mathematical terms, we will approach this using techniques for finding the roots or zeros of equations: http://en.wikipedia.org/wiki/Root-finding_algorithm So the first step is to re-write the equation so it is in a form z=f(x)-y=0

    I need to know how I can solve an equation using excel macro
    Does it have to be a macro?? The built in Solver utility will easily find the roots of equations (if you set up the spreadsheet correctly) without additional programming. If it has to be a macro, I see two approaches:

    1) Call Solver from within VBA -- probably easiest to record a macro using the macro recorder while you call Solver manually. Then adapt the resulting code to your needs.

    or
    2) Write your own root finding algorithm (using one of the methods mentioned in Wikipedia). When I must do it in VBA, I will usually write my own algorithm, because I have found it easier to do that than to figure out the nuances of working with Solver from within VBA.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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