totn Excel Functions

MS Excel: How to use the SUM Function (WS)

This Excel tutorial explains how to use the Excel SUM function with syntax and examples.

Description

The Microsoft Excel SUM function adds all numbers in a range of cells and returns the result.

The SUM function is a built-in function in Excel that is categorized as a Math/Trig Function. It can be used as a worksheet function (WS) in Excel. As a worksheet function, the SUM function can be entered as part of a formula in a cell of a worksheet.

subscribe button Subscribe

Syntax

The syntax for the SUM function in Microsoft Excel is:

SUM( number1, [number2, ... number_n] )

OR

SUM ( cell1:cell2, [cell3:cell4], ... )

Parameters or Arguments

number
A numeric value that you wish to sum.
cell
The range of cells that you wish to sum.

Returns

The SUM function returns a numeric value.

Note

  • You can sum combinations of both numbers and ranges of cells using the SUM function.

Applies To

  • Excel for Office 365, Excel 2019, Excel 2016, Excel 2013, Excel 2011 for Mac, Excel 2010, Excel 2007, Excel 2003, Excel XP, Excel 2000

Type of Function

  • Worksheet function (WS)

Example (as Worksheet Function)

Let's look at some Excel SUM function examples and explore how to use the SUM function as a worksheet function in Microsoft Excel:

Microsoft Excel

Based on the Excel spreadsheet above, the following SUM examples would return:

=SUM(A2:A6)
Result: 231.2

=SUM(A2, A3)
Result: 17.7

=SUM(A3, A5, 45)
Result: 57.6

=SUM(A2:A3, A5:A6)
Result: 31.2

=SUM(A2:A3, A5:A6, 500)
Result: 531.2

The SUM function is also a great function if you want to add values across a row. For example:

Microsoft Excel

Based on the Excel spreadsheet above, the following SUM function would return:

=SUM(A2:E2)
Result: 231.2

Frequently Asked Questions

Question: I have a question about how to write the following formula in Excel.

I have a few cells, but I only need the sum of all the negative cells. So if I have 8 values, A1 to A8 and only A1, A4 and A6 are negative then I want B1 to be sum(A1,A4,A6).

Answer: You can use the SUMIF function to sum only the negative values as you described above. For example:

=SUMIF(A1:A8,"<0")

This formula would sum only the values in cells A1:A8 where the value is negative (ie: <0).