Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sigma or Summation function in Excel

Tags:

excel

Given a value (in a cell), calculate a formula like this:

Ʃ(3i+1) for i from 0 to the value specified in the cell.

SUM(), SERIESSUM() are not suitable in this case. How can I do this in Excel? Much thanks!

like image 307
pythonician_plus_plus Avatar asked Jun 27 '16 02:06

pythonician_plus_plus


3 Answers

To leave you all options, just use this:

=SUMPRODUCT(3*(ROW(A1:INDEX(A:A,B1-A1+1))-(1-A1))+1)

A1 is the lower limit and B1 is the upper limit... will also work for ranges like i = -5 to -3 ;)

like image 182
Dirk Reichel Avatar answered Oct 16 '22 21:10

Dirk Reichel


Demo as below graph:

Write in B2 Cell with =SUM(3*(ROW(INDIRECT(CONCATENATE("1:",A2+1)))-1)+1) then press Ctrl + Shift + Enter.

enter image description here

like image 32
PaichengWu Avatar answered Oct 16 '22 20:10

PaichengWu


Use the array formula:

=SUM(3*ROW(INDIRECT("1:" & A1))+1)+1

enter image description here

Array formulas must be entered with Ctrl + Shift + Enter rather than just the Enter key.

like image 3
Gary's Student Avatar answered Oct 16 '22 21:10

Gary's Student