Ask Your Question
1

Does Calc have a summation function?

asked 2012-03-03 00:30:52 +0200

TJ Meneses gravatar image TJ Meneses
252 4 10 22

updated 2012-03-06 10:09:16 +0200

I apologize if this question is pretty straightforward and possibly common knowledge, but I've been trying to google it in as many permutations of the question as my brain can allow, and I have not seen a single straightforward answer to this. The only real reference of LibreOffice even having an actual summation (not sum) feature is in Math, which is strictly notation.

Let me kindly clarify my question: I am not asking whether there is a SUM function (that is definitely common knowledge); I am asking whether or not there is a SUMMATION function (i.e. sum [expression] from i=a to b) in Calc.

If there is, kindly refer me to the correct formula/documentation of the function. If not, well... bummer. I'm having trouble finding this function in Excel as well, but a colleague mentioned it did have this, which is called through ADDSUM() or something. I wouldn't know; I'm a faithful user of Calc.

Edit: I suppose my question is still a little vague, or at least the details of what I'm trying to look for, so I'll make an example with a hypothetical function I'll call SUMM(). This function would receive 4 arguments, which is the same number of terms you need to input in the summation formula in Math.

Regarding the arguments. First, there would be the expression to be used, for example "5+6*i", where i is the variable you'll use to define your range. Second would be the letter you used in your expression, in this case "i". The third and fourth arguments would receive the lower and upper bounds of the range of values of i, respectively.

The format of the hypothetical function would look something like SUMM(expression,variable,lower_bound,upper_bound). It could link to other cells for certain values or references of the expression, but can also calculate a value without any references, given you supplied it with the proper information.

I hope I made my question clearer.

delete close flag offensive retag edit

Comments

I've discovered a possible solution to the (as of my current knowledge) lack of a summation function: Basic programming. Only problem is, I know next to nothing on how to use it. I'll try to make a user-defined function for the one I'm describing, and if it works, I'll post it as an answer.

TJ Meneses ( 2012-03-10 17:37:18 +0200 )edit

6 Answers

Sort by » oldest newest most voted
0

answered 2012-03-16 16:07:29 +0200

TJ Meneses gravatar image TJ Meneses
252 4 10 22

Based on my original question, and after doing a bit more research, it's become painfully obvious that LibreOffice Calc simply does not have a function for summations. There is no single function, or even combination of functions, that will calculate the sum of an expression f(x) from x=a to b (there are workarounds, but all techniques I've heard from others are array-based, not single-cell solutions).

The interesting thing is that my calculator has this pretty basic function, and the syntax and logic isn't even that difficult to implement. I suppose there just aren't enough people asking for an implementation of this function.

I'm still trying to implement it myself through the Basic programming language, but I'm also having a bit of trouble finding documentation for it. Maybe when I have free time, I'll decide to learn how to create an extension for it so other people might be able to use it.

link delete flag offensive edit
1

answered 2012-03-06 23:03:15 +0200

mariosv gravatar image mariosv flag of Spain
4599 20 45

Maybe: Menu/Data/MultipleOperations can help. See in the help how it works. To access the menu entry first select a range.

link delete flag offensive edit
1

answered 2012-03-03 08:27:57 +0200

Irishman gravatar image Irishman
121 2 7
http://ask.libreoffice.or...

There is SUMIF(range; criteria; sum_range) function in Calc, which "Adds the cells specified by a given criteria. The search supports regular expressions. Range is the range to which the criteria are to be applied. Criteria is the cell in which the search criterion is shown, or the search criterion itself. Sum_range is the range from which values are summed; if it has not been indicated, the values found in the Range are med.". Information about all Calc function you can find here (Appendix B - Calc Functions). I hope this information will be helpful for you.

link delete flag offensive edit

Comments

Article in documentation with example about SUMIF function - http://help.libreoffice.org/scalc/SC_HID_FUNC_SUMMEWENN?Language=en&System=WIN&Version=3.5#bm_id3151969

Irishman ( 2012-03-03 08:36:32 +0200 )edit

Thanks for that info. Actually, I have already browsed all of Calc's functions on that page before, and I do know about SUMIF(), but that's another array-based solution. What I'm looking for is a single-cell function where you can input all the data you need as arguments.

TJ Meneses ( 2012-03-06 09:59:57 +0200 )edit
0

answered 2012-03-03 00:49:21 +0200

mariosv gravatar image mariosv flag of Spain
4599 20 45

Maybe it is possible to do with an array expression, but with a more detailed explanation about what to do, would be easier to find a solution.

link delete flag offensive edit

Comments

Yeah, my current solution is array-based, but that takes up so much space than if there were a single function to fill one cell with. Additionally, trying to account for the variable nature of the upper and lower bounds is pure hell.

TJ Meneses ( 2012-03-03 01:19:14 +0200 )edit
0

answered 2012-09-08 05:48:36 +0200

momothefiddler gravatar image momothefiddler
1

This requires the Eval() function from here, but this seems to work fine:

Function SUMMATION(lowerbound, upperbound, variable, formula)
    SUMMATION=0
    FOR i=lowerbound to upperbound
        this=join(split(formula, variable), i)
        SUMMATION=SUMMATION+EVAL(this)
    NEXT i
End Function
link delete flag offensive edit
-1

answered 2012-03-06 10:57:44 +0200

yecril71pl gravatar image yecril71pl
36 1 4

Sum of (5 + 6 i), where (i) ranges from (0) to (N), will be (N (3 N + 8) + 5). Pretty straightforward.

link delete flag offensive edit

Login/Signup to Answer

Donate

LibreOffice is made available by volunteers around the globe, backed by a charitable Foundation. Please support our efforts: Your donation helps us to deliver a better product!

Question tools

Follow

subscribe to rss feed

Stats

Asked: 2012-03-03 00:30:52 +0200

Seen: 971 times

Last updated: Sep 08 '12