Sigma formula function in Numbers

Hi,

I am looking for a function for sigma formula working in Numbers. ex, "Sigma function" 2+5*(X-3), X=1,2,3,....n.

After searching, I found a combination of formula for Excel works:

=SUMPRODUCT(2+5*(ROW(INDIRECT("1:"&$A$1))-2))


But this formula doesn't work in Numbers. The reason seems the Numbers treat ROW function different to Excel, that is, if you insert ROW(INDIRECT("1:"&A1), Numbers returns only 1 but Excel returns a column of rows 1,2,3,....


How can I create a sigma formula working in Numbers? Thank you.


Posted on Aug 4, 2020 7:02 PM

Reply
12 replies

Aug 7, 2020 5:55 PM in response to yceh

That was what I was thinking of.


The Excel formula is an "array" formula, which is not something available in Numbers. In Excel it is entered a special way to make it an array formula vs a regular formula. It is calculating the ROW() function for ALL the rows in the formula and making an array of the results, which it then uses in the rest of the formula to do all the calculations for all the rows. If entered as a regular formula, it would calculate only the first ROW() and do one calculation, which is what Numbers is doing. The other thing the formula relies on is Excel's monolithic worksheets. By default they have many many rows and columns. The worksheet (table) has to have at least n rows for the formula to not throw an error and Excel has that by default. In Numbers, the default table is only 22 (or 10) rows. If you need n=900,000, for example, it would require you manually create a table with 900,000 rows.

Aug 7, 2020 9:02 PM in response to yceh

Is that the actual equation? It can be broken down into a formula also


where m= -0.3


The sum = (1 + (1 - e^((n-1)*m))/(e^-m - 1) - ne^nm)/(e^-m - 1) -5*(1-e^nm)/(e^-m - 1)


Or, in Numbers format where n is in cell D1,


=(1+(1−EXP(−0.3×(D$1−1)))÷(EXP(0.3)−1)−D$1×EXP(−0.3×D$1))÷(EXP(0.3)−1)−5×(1−EXP(−0.3×D$1))÷(EXP(0.3)−1)


I'd show the solution but it is so hard to read (and write) this stuff as single line text vs true equation format.

Aug 7, 2020 6:28 PM in response to Badunit

WOW!! That is awesome, really. Thank you for the equation simplify ;)


No. The equation is just for demonstration. The equation I need is involving the (natural) exponential function like ∑e^-0.3*(n-5), n=1,2,3..... which I really wish I can break it down.


But I think simplifying ∑x for x=1...n to n(n+1)/2 is such a brilliant way. Good job!

Aug 7, 2020 6:24 PM in response to yceh

Is the equation you provided the sum of (2+5*(x-3)) from x=1 to n the actual equation you are wanting an answer to? It can be simplified to not require calculating each part and adding them up.


∑(2 + 5(x-3)) for x=1...n

=∑(2+ 5x - 15) for x=1...n

=∑(-13 + 5x) for x=1...n

=-13n + 5∑x for x=1...n

=-13n + 5n(n+1)/2


I was playing around in Excel and you are correct; ROW works differently in Excel. ROW(INDIRECT("1:"&A1)) will create an array of results in Excel even when not entered as part of an array formula. In Numbers it gives the first value only.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Sigma formula function in Numbers

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.