Formula for x & y calculation

K

K. Carter

I need help building a formula to calculate both the "x" and "y" values for
the following equation:

x + y = 90
2.15x + 2.4y = 202.35

The solution would be x = 45 and y = 44, but I haven't found a formula that
work yet!
 
B

Bernie Deitrick

KCarter,

Actually, the solution you give only applies to x + y = 89 ;-)

You need to learn to do matrix math.

So, enter your x coefficients in A1 and A2, your y coeff in B1 and B2, and your solution values in
C1 and C2:

1 1 89
2.15 2.4 202.35

Then select D1 AND D2, enter

=MMULT(MINVERSE(A1:B2),C1:C2)

and press Ctrl-Shift-Enter.

You will then get 45 and 44. If you had 90 in cell C1, you would get 54.6 and 35.4.

HTH,
Bernie
MS Excel MVP
 
J

John C

The solution cannot be x=45 and y=44
Your first formula is x+y=90, and 45+44 <> 90.
Solve your first formula for y. (y=90-x)
Plug in the 90-x into your second formula
2.15x+2.4(90-x)=202.35
Multiply 2.4 * (90-x)
2.15x+216-2.4x=202.35
Add 2.15x and -2.4x and subtract 216 from both sides
-.25x=202.35-216 (-13.65)
Solve for x
x=-13.65/-.25 = 54.6
Solve for y
y=90-54.6=35.4
 
B

Bernard Liengme

If the math in the two very good answers is beyond you, then send me private
email and I will show you how to use Solver for this type of problem
best wishes
 
K

K. Carter

Thanks ever so much Bernie.....John's reply works as well but yours is much
faster and will save me a tremendous amount of time! Much appreciated!!! (I
will add matrix math to my list of things to learn - just learning the term
was my "something new" for today).

tks....Kim
 
B

Bernie Deitrick

Kim,

And note that you are not limited to two equations with two unknowns - this technique works for
higher order systems of equations, which are much harder to solve manually.

HTH,
Bernie
MS Excel MVP
 

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

Top