ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Creating Rules (https://www.excelbanter.com/excel-programming/360282-creating-rules.html)

dorn

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

Ivan Raiminius

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


Still Learning

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




All times are GMT +1. The time now is 01:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com