How to use the Polynomial Trendline Formula - excel

So the blue line graph has values from column CM (x values are in column CF, sorry for the confusing presentation). I want to recreate the polynomial trendline that I had excel generate for it, which is what I'm trying to do in column CH, as you can see from the formula bar.
Excel gives me the formula y = -0,0006x^2 + 0,013x + 0,1878 (shown on the chart) which I then have entered into the values in column CH.
The result is unfortunately not even close (displayed as the orange line graph). Is there any person here sharp enough on maths to tell me what I'm doing wrong?

This is the formula to obtain 2nd Order Polynomial Trendline:
y = (c2 * x^2) + (c1 * x) + b
c2: =INDEX(LINEST(y,x^{1,2}),1)
c1: =INDEX(LINEST(y,x^{1,2}),1,2)
b: =INDEX(LINEST(y,x^{1,2}),1,3)
So now, just examined your formula, you have incorrect parameters (b, c1 and c2) used so the result is different.
Here are the formulas I used to obtain these three parameters:
c2: =INDEX(LINEST($CM$1234:$CM$1262,$CF$1234:$CF$1262^{1,2}),1)
c1: =INDEX(LINEST($CM$1234:$CM$1262,$CF$1234:$CF$1262^{1,2}),1,2)
b: =INDEX(LINEST($CM$1234:$CM$1262,$CF$1234:$CF$1262^{1,2}),1,3)
Then I got:
c2 (cell CG1227) = -0.05675
c1 (cell CG1228) = -0.04025
b (cell CG1229) = 0.25509
Now, from cell CH1234, this formula is used:
=($CG$1227*CF1234^2)+($CG$1228*CF1234)+$CG$1229
I have the outcome matched with the Polynomial Trendline. Try and see if this works for you.

Related

Solving simultaneous equations in excel

I have 4 equations, with 4 unknowns, a,b,c,e
w = c + 0.43*a
x + gb = pc + 2*e
y + 2a + hb = qc + 20.43a + e
z + bi = cr
What would be the best way to solve this in Excel?
I searched and found that LINEST might be a good function to use, but couldn't get it to work
Thanks
First rewrite all you formulas in the form
Ai*(a)+Bi*(b)+Ci*(c)+Ei*(e)=Ki
Then for each equation fill out a row in the matrix
A1 B1 C1 E1 a K1
A2 B2 C2 E2 x b = K2
A3 B3 C3 E3 c K3
A4 B4 C4 E4 e K4
Then use MInverse and MMultiply functions to solve for a,b,c and e
A,B,C,E are the constants multiplying each variable. Set them to 0 when they are not in the formula, and make sure you carry the negative sign.
i is just a way to represent the equation number.
K is the constant in the equation with out a variable attached to it.
So provided I did the formula rearrangement properly, one possible result would be:
Cant take it farther than this as numbers would be needed for g, p, h, q, i, and r (not to mention w, x, y, and z). Though you could set those up in cells so you sheet would automatically update when you entered values.

Find all increments of +1's starting from a given number in a column in excel

I have 2 columns x and y
x Y
0 1
1.645 7.897
3.444 6.4387
2.345 5.9090
3.890 5.4322
4.789 3.4321
5.666 4.1111
keeping x at a constant value ( say i pick 3.890) i want to find all increments of +1's of the corresponding Y column . In the above example I want (5.4322 + 1 + 1 + 1 ) upto a certain range.In the above example i want the values (6.4387, 7.987) .If an exact +1 value does not exist i want the closest value to it .Is there a formula i can use to achieve this in excel ? . Any help is much appreciated.
expected output :
New column
5.4322
6.4387
7.897
Suppose you have the following named ranges:
x being values under x column;
y being values under y column;
Pick_x being the selected value from x column.
Enter the following formula in Cell G2 and drag it down to G8:
=IF(INDEX(y,MATCH(Pick_x,x,0))+1*(ROW(A1)-1)>MAX(y),"",INDEX(y,MATCH(Pick_x,x,0))+1*(ROW(A1)-1))
It will return the corresponding y value +1s based on the selected x value, but will show blank if the +1 value is outside the range set by y column.
Then enter the following array formula (confirm by pressing Ctrl+Shift+Enter in the formula bar) in Cell H2 and drag it down to H8:
{=IFERROR(INDEX(y,MATCH(MIN(ABS(y-G2)),ABS(y-G2),0)),"")}
It will return the corresponding closes match from y column based on the value in Column G, and return blank if there is no value in Column G.
I used Column G as a helper column but you can choose to replace G2 in the second formula with the first formula, but it will make the formula too long to be easily understood.
If I change the x value to 4.789, Column H will return the following:
Let me know if I've misinterpreted your question. Cheers :)

Extracting the Projected Data in Excel

When we add a trendline to a chart, Excel provides an option to display the trendline equation in the chart.
We can then use these formulas to calculate predicted y values for give values of x
The formulea are nicely listed by SpreadSheetPage.Com
I wanted to implement the same in the excel sheet for a dataset like given below:
Year Value
1990 400
1991 494
1992 449
1993 554
1994 600
1995 499
1996
1997
1998
1999
2000
As you can see, I wanted to project the values for the years 1996 to 2000 using 2nd Order Polynomial.
Using the equations provided by SpreadSheetPage.Com
2nd Order Polynomial Trendline
Equation: y = (c2 * x^2) + (c1 * x ^1) + b
c2: =INDEX(LINEST(y,x^{1,2}),1)
C1: =INDEX(LINEST(y,x^{1,2}),1,2)
b = =INDEX(LINEST(y,x^{1,2}),1,3)
I calculated C2 and the stored the value in a cell whith cell address say C2.
Similarly, I calculated C1 and stored the value in a cell with cell address say C1. I also calculated b and stored the value in a cell with cell address say C3.
Then, in the cell besides the year 1996 (whoes value I want to project), I entered the formulea = (c2 * x^2) + (c1 * x ^1) + C3 and Ctr+Shift+Entered for the array formulea while selected the value cells from 1996-2000.
The results were not as expected. I am sure I am not using these equations in their proper way. Any help in this regard will be highly appreciated.
Please not I have made named arrays x and y for known x's and known y's respectively.
Given the limitation that you don't provide your actual or expected results:
Assume your known table is A1:B7, and your ranges are named as you mentioned:
B8: = (C$2 * A8^2) + (C$1 * A8 ^1) + C$3
and fill down to B12
Using a different function, you could use:
B8: =TREND(y,x^{1,2},A8:A12^{1,2})
Then select B8:B12 and enter as an array with ctrl+shift+enter. Note that this function may be inaccurate in versions of Excel prior to 2007.
EDIT
Note that the original formula can be entered as an array if we replace A8 with A8:A12; and the TREND function can be entered normally, and filled down, if new_x is entered as a single cell, instead of a range.

Simple mathematical mystery from Excel

I got a problem to understand on first sight simple to reproduce mathematical problem as follows:
The Table
The first 5 rows of columns A-D are simple numbers. The first 5 rows of column E are E=D/C. The first 5 rows of column F are F=(B-A)+(A*E).
Then the sums row sums up A-D. The number G (just under) equals to Sum(D)/Sum(C) and consequently I=(sum(B)-sum(A))+(sum(A)*G). H=sum(the previous F rows).
Now the question is: Why doesn't H equal I ??? That is, why in this case doesn't sum of partial results equal to the calculation made from sums of the columns?
Dont mess with calculation precedence!
Let's simplify this using only two rows:
F1 is =B1-A1+A1*D1/C1 and F2 is =B2-A2+A2*D2/C2
So F4, your H, is =B1-A1+A1*D1/C1+B2-A2+A2*D2/C2
F6, your I, is =B1+B2-A1-A2+((A1+A2)*(D1+D2)/(C1+C2))
You claim, H should be equal I:
B1-A1+A1*D1/C1+B2-A2+A2*D2/C2 = B1+B2-A1-A2+((A1+A2)*(D1+D2)/(C1+C2))
Subtract B1, B2, and add up A1, A2 on both sides:
A1*D1/C1+A2*D2/C2 = ((A1+A2)*(D1+D2)/(C1+C2))
This is simply not true.
In your table E7 = D7 / C7 and this is different from sum(E1:E5) because of the formulas involved. The value 293.5 corresponds to the case when E7 = sum(E1:E5) and the value 296.4 to the case where E7 = D7/C7.
UPDATE
The two formulas for F7 you are trying to compare are mathematically different.
One is
(B1-A1) + A1*E1 + (B2-A2) + A2*E2 + ... + (B5-A5) + A5*E5
= (B7-A7) + (A1*E1 + ... + A5*E5)
= (B7-A7) + (A1*D1/C1 + ... + A5*D5/C5) (1)
and the other
(B7-A7) + A7 *(D1+D2+D3+D4+D5)/(C1+C2+C3+C4+C5) (2)
Only the first term (B7-A7) is the same in both expressions. The rest is different. In (1) you first multiply and divide Ai*Di/Ci and then sum. In (2) you first sum the Ai, Di and Ci and then multiply the sums.

Formula to change another cell

I'm a novice in excel. I'm using Excel 2010. My spreadsheet looks something like this:
0 A B C D
1 X 10€ X: (sum of all incomes, made by A)
2 Y 20€ Y: (sum of all incomes, made by B)
3 Z 5€ Z: (sum of all incomes, made by C)
4 X 4€
5 Z 6€
I have a list of incomes and outcomes, collected/paid for by 3 different persons. I'd like to format the first column: if the content of the cell is 'X', the income in that row is added to X's sum of all incomes, if it's Y, add to Y's sum, same for Z.
Something like this (for A1):
"if content = X, add B1 to D1; if content = Y, add B1 to D2; if content = Z, add B1 to D3"
How do I write the formula?
Use the =SUMIF() formula.
Before you start, remove the colons from C1, C2 and C3.
In D1 write this formula:
=SUMIF($A$1:$A$5,C1,$B$1:$B$5)
... and copy or drag the formula down to D2 and D3.
Remember the $-signs in the formula to lock the ranges when copying or dragging.

Resources