Quote:
Originally Posted by Jacky837
How do I insert the formula you posted?
|
I have no idea as I haven't programmed in anything like VBA or any form of BASIC in almost 50 years; the last flavor of Basic I programmed in was the first; Dartmouth Basic by Kemeny and Kurtz as a freshman at Nevada Southern University - now UNLV.
John Leibniz when he was about 12, so the story goes, was smarter than his teacher and his teach told him add all the numbers from 1 to 100; Leibniz reasoned that 1 and 100 was 101, 2 and 99 was 101, etc. and therefor n * (n + 1) / 2 was the sum of 1 to n.
A C# or C function would be
public int SumToN (int n)
{
return n * (n + 1) / 2 ;
}
All I was trying to say is break your formula into pieces. I really don't have time figure out how to post a formula; I suggest you look on page 47 of the document below to understand what I was trying to convey as it is an example of defining yBar in (2.1) and then using yBar in the (2.2) to define sigmaHat squared.
https://www.epa.gov/sites/production...tech-guide.pdf