Sperethiel
Blogger
0
1651

# How do I sum a figure derived from a row of cells

How do I sum a figure derived from a row of cells

• ### Cloud Payroll Software Recommendations

I wish to calculate the sum of the results of an operation applied to the numbers - for example, sum the squares of the numbers. "f(x)"

Is it possible to combine the summation with the operation without having a separate cell showing "f(x)"?

i.e. sum(f(A1):f(A21))

thanks,

S.

### Replies

By ACDWebb
12th Apr 2012 17:48

For squares

you could try SUMSQ()

This may help - taken from Help for SUMPRODUCT()

Using arrays provides a more general solution for doing operations similar to SUMPRODUCT. For example, you can calculate the sum of the squares of the elements in A2:B4 by using the formula =SUM(A2:B4^2) and pressing CTRL+SHIFT+ENTER

Thanks (0)
By shurst
13th Apr 2012 22:19

Or SUMPRODUCT() on its own

SUMSQ() is probably the answer for the specific problem but SUMPRODUCT() is often worth considering as an easier alternative to an array formula, avoiding the need for the Ctrl+shift+enter. It works because it takes one or more arrays as arguments. For example in this case you could try:

=SUMPRODUCT((I15:K15)^2)

or for cubes:

=SUMPRODUCT((I15:K15)^3)

Thanks (0)