SUM function
This article describes the formula syntax and usage of the SUMfunction in Microsoft Excel.
Description
The SUM function adds all the numbers that you specify as arguments. Each argument can be a range, a cell reference, an array, a constant, a formula, or the result from another function. For example, SUM(A1:A5) adds all the numbers that are contained in cells A1 through A5. For another example, SUM(A1, A3, A5) adds the numbers that are contained in cells A1, A3, and A5.
Syntax
SUM(number1,[number2],...])
The SUM function syntax has the following arguments:

number1 Required. The first number argument that you want to add.

number2,,... Optional. Number arguments 2 to 255 that you want to add.
Remarks

If an argument is an array or reference, only numbers in that array or reference are counted. Empty cells, logical values, or text in the array or reference are ignored.

If any arguments are error values, or if any arguments are text that cannot be translated into numbers, Excel displays an error.
Example
Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust the column widths to see all the data.
Data 

5 

15 

30 

'5 

TRUE 

Formula 
Description 
=SUM(A2,A3) 
Adds the value in cells A2 and A3. The result is 10. 
=SUM(A2:A4,15) 
Adds the values in cells A2 through A4 first, and then adds 15. The result is 55. 
=SUM("5", 15, TRUE) 
Adds 5, 15 and 1. The text value "5" is first translated into a number, and the logical value TRUE is first translated into the number 1. The result is 21. 
=SUM(A5,A6, 2) 
Adds the values in cells A5 and A6, and then adds 2 to that result. Because nonnumeric values in references aren't translated— the value in cell A5 ('5) and the value in cell A6 (TRUE) are both treated as text—the values in those cells are ignored. The result is 2. 