Creating Rules

G

Guest

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!
 
I

Ivan Raiminius

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
 
G

Guest

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Scrabble Value calculation for Welsh words 0
Fill array with Values 4
Incrementing IPv6 address 1
Group 1
random sampling TEXT 1
Hierarchy Macro 10
Block If 16
Someone locked you out of your BIOS, never ferr. 15

Top