O'Reilly logo

Excel Scientific and Engineering Cookbook by David M Bourg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

7.1. Using Summation Functions

Problem

You're performing calculations that require summations of large amounts of data (for example, for least-squares curve fitting) and would like to use built-in functions that make such summation computations easy.

Solution

Use Excel's built-in summation functions such as SUM, SUMSQ, SUMPRODUCT, and SUMX2MY2.

Discussion

Excel includes several built-in functions that make performing summations of large (or small) amounts of data very easy. Perhaps the most common sum function is SUM, which simply adds all values contained in a range of cells. For example, =SUM(B2:B24) adds all the values contained in cells B2 to B24. The range of cells does not have to be contiguous either. For example, =SUM(B2:B24,C2:C24) adds all the values contained in each cell range (you separate cell ranges with commas). You can even include explicit values like this =SUM(B2:B24,1). In this case, the values contained in the range plus the specified value, 1, are added.

Tip

Most of Excel's functions that take cell ranges or multiple values as arguments allow you to mix cell references and values, using commas as separators.

Table 7-1 contains a list with short descriptions of several of Excel's convenient summation functions.

Table 7-1. Common summation functions

Function

Syntax

Description

SUM

=SUM( n1 , n2 , n3 , ...)

Returns the sum of all given numbers, which may include cell ranges and explicit numbers.

SUMPRODUCT

=SUMPRODUCT( array1 , array2 , ...)

Adds ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required