ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Formula for x & y calculation (https://www.excelbanter.com/excel-worksheet-functions/198010-formula-x-y-calculation.html)

K. Carter

Formula for x & y calculation
 
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!

Bernie Deitrick

Formula for x & y calculation
 
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


"K. Carter" wrote in message
...
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!




John C[_2_]

Formula for x & y calculation
 
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



--
John C


"K. Carter" wrote:

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!


Bernard Liengme

Formula for x & y calculation
 
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
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"K. Carter" wrote in message
...
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!




K. Carter

Formula for x & y calculation
 
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

"Bernie Deitrick" wrote:

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


"K. Carter" wrote in message
...
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!





Bernie Deitrick

Formula for x & y calculation
 
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


"K. Carter" wrote in message
...
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

"Bernie Deitrick" wrote:

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


"K. Carter" wrote in message
...
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!








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

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