How to calculate sum in MS Excel

Share

The SUM function in Microsoft Excel is a tool for adding a range of values. The SUM function may help us rapidly get the total, whether we’re dealing with a simple set of data or a more complex spreadsheet.

Syntax

The basic syntax for the SUM function is as follows:

=SUM(number1, number2, ...)

Here, number1 and number2 represents the cell number or any numeric value. It's worth noting that we have the flexibility to include additional cells as needed.

Note: Instead of using explicit values, we can also use ranges or cell references.

Examples

Following are the basic examples of how to use SUM:

Simple values

=SUM(10,20,30)

List of cells

=SUM(A1,A2,A3)

Range of cells

=SUM(A1:A3)

Steps

The following is a step-by-step guide to using the SUM function:

  1. Select the cell: We click on the cell where we want the sum to appear.

  2. Use the SUM function: We type =SUM( into the selected cell.

  3. Select the range: If we want to sum the values in cells A1 to A5, there are two ways to achieve the desired result:

    1. We can enter “A1:A5” after the opening parenthesis and then close the parenthesis and press “Enter.” The formula should look something like this: =SUM(A1:A5).

    2. We can also enter “A1,A2,A3,A4,A5” after the opening parenthesis and then close the parenthesis and press “Enter.” The formula should look something like this: =SUM(A1,A2,A3,A4,A5).

Let’s now apply the steps above on our dataset. Let's suppose we have the following dataset:

Dataset to calculate SUM
Dataset to calculate SUM

Now, our objective is to determine the total sales generated by the given dataset. We aim to calculate the sum of sales for all the products mentioned in the dataset. There are two ways to calculate the sum. Let’s use both:

Calculating the sum with list of cells

First we select the cell, where we need to calculate the sum. Let’s suppose here the cell number is B12. After we select the “cell(B12),” write the following in the cell:

=SUM(B2,B3,B4,B5,B6,B7,B8,B9)

Let's visualize the above steps in action.

Selecting the cell B12 to calculate the sum
1 of 3

Note: As we can see in the slides above, when multiple cells are added, the system automatically highlights the cell number and alters its color for easier identification.

If an empty cell is included in a sum formula and subsequently populated with a value, the total in cell B12, where the sum is calculated, will automatically update to reflect the new value.

Calculating the sum by specifying the range

First we select the cell, where we need to calculate the sum. Let’s suppose here the cell number is B12. After we select the “cell(B12),” write the following in the cell:

=SUM(B2:B9)

Let's visualize the steps above in action.

Selecting the cell B12 to calculate the sum
1 of 3

If any of the given values are not numbers, it throws the #VALUE! Error.

Copyright ©2024 Educative, Inc. All rights reserved