+ Reply to Thread
Results 1 to 3 of 3

Creating Rules

  1. #1
    Dorn
    Guest

    Creating Rules

    I'm trying to make a macro that will create rules to solve problems based on
    a bunch of interrelated vairables. I'm new to visual basic and I'm not sure
    how I go about starting this process. I want to be able to enter in the
    variables I know and have possible solutions for the unknown variables. I
    don't think I can do this conventionally with functions because there are
    cirular references in some of the rules.

    For sake of this example my variables are: A, B, C, D, E, F, G, H, W, J, K,
    L, M, N, X, P, Q, R, S, and T

    (I used W and X instead of I and O so they don't get confused with numbers)

    I want to be able to enter each variable into a cell and have a macro
    simultaneously satisfy the following rules:

    1) A=B+C+D+E
    2) B=A*.1
    3) C=A*.2
    4) D=A*.65
    5) E=A*.05
    6) F=((A*.1)*G)+((A*.2)*H)+((A*.65)*W)+((A*.05)*J)
    7) 52*5=X
    8) K=10
    9) L=10
    10) M=5
    11) N=X-(K+L+M)
    12) P=N*8*60*Q
    13) R=S
    14) T=P/S
    15) F=T

    If anyone could point me in the right direction I would really appreciate
    it! If this is possible with functions that would be much more familiar to
    me (though I don't mind using vb at all if I know how to look up what I don't
    know)

    Thanks!

  2. #2
    Ivan Raiminius
    Guest

    Re: Creating Rules

    Hi,

    you can calculate what you need using circular references (in fact
    circular references might be really useful, if you know how to use
    them). I didn't study your formulas in detail, but maybe you will have
    to rearange their position (means which is calculated first, second
    ....) to achieve result you expect.

    Look for inspiration at Stephen Bullen's page:

    http://www.oaltd.co.uk/Excel/Default.htm

    (file Previous.zip).

    Regards,
    Ivan


  3. #3
    Still Learning
    Guest

    Re: Creating Rules

    I've set up all of the variables and the equations on this sheet:

    http://www.savefile.com/files/8301241

    I tried using the iterate circular reference trick but I couldn't get it to
    work for me. Does anyone know where I'm messing up? Is there an easier
    macro solution?

    Thanks again everyone!

    "Ivan Raiminius" wrote:

    > Hi,
    >
    > you can calculate what you need using circular references (in fact
    > circular references might be really useful, if you know how to use
    > them). I didn't study your formulas in detail, but maybe you will have
    > to rearange their position (means which is calculated first, second
    > ....) to achieve result you expect.
    >
    > Look for inspiration at Stephen Bullen's page:
    >
    > http://www.oaltd.co.uk/Excel/Default.htm
    >
    > (file Previous.zip).
    >
    > Regards,
    > Ivan
    >
    >


+ 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