In LibreOffice Calc the following works; since the two programs are mostly the same, it should work in OpenOffice Calc, too. Use the formula
=SUM(A1:X1^2/(1+A1:X1))
; then hit CTRL + Shift + Enter to make it an array formula.
In general, a formula that takes single values and returns a single value (e.g., =A1 + B1
and hit Enter) can be made to take and return a range by making it an array formula (e.g., formula is =A1:A3 + B1:B3
and hit Ctrl + Shift + Enter). In this example, the formula will return three values, A1+B1, A2+B2, and A3+B3. (If you type this in directly in cell C1, the program will also fill cells C2 and C3.) Rather than displaying those values directly on the spreadsheet, you can, as in the question, pass those values to SUM or any other function that accepts a range of values (=SUM(A1 + B1)
and hit CTRL + Shift + Enter).
EDIT:
With the mathematical function f(x)=x2/(1+x) from your question, in Calc you can replace x either with a single cell (e.g., A1) in a regular formula, producing a single value, or with a range (e.g. A1:X1), producing one value for each value in the range. In your formula, you just replace the single cell with a range (A1:X1^2
etc. instead of A1^2
etc.) and hit CTRL + Shift + Enter to make it an array formula.
Technical info on how this works under the hood: A1:X1
in the formula is evaluated as the list (or array, hence the name array formula) {A1, B1, ..., X1}
. A1:X1^2
produces the list {A1^2, B1^2, ..., X1^2}
. Since A1:X1
is in the formula twice, there are two lists; when the division is evaluated, {A1^2, B1^2, ..., X1^2}/{1+A1, 1+B1, ..., 1+X1}
becomes {A1^2/(1+A1), B1^2/(1+B1), ..., X1^2/(1+X1)}. This list is what SUM sums.