ExcelMathBeginner

SUM

Adds all numbers in a range of cells.

Read the syntaxReview worked examplesOpen the spreadsheet app
=SUM(number1, [number2], ...)

This static page keeps the function indexed for search, while the spreadsheet app handles interactive exploration and saved formulas.

What the function does

Overview

Adds all numbers in a range of cells.

The SUM function is a foundational math function used to calculate the total of a series of numerical values. It accepts up to 255 individual arguments, which can include constants, cell references, or range arrays. A critical technical behavior of SUM is its handling of non-numeric data: it automatically ignores empty cells, logical values, and text strings when they are contained within a referenced range. However, if you pass a text string or a logical value directly as an individual argument (e.g., =SUM("text")), it will return a #VALUE! error. Best practices involve using range references (e.g., A2:A100) rather than individual additions (A2+B2+C2) because the SUM function is more resilient to errors when text is present. One important edge case is that if any single cell within the referenced range contains an error value, the entire SUM function will fail and return that same error. For scenarios involving hidden rows or filtered lists, consider using SUBTOTAL or AGGREGATE instead.

Quick reference

Syntax

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

Inputs

Arguments

number1First number or range to add
Example: A2:A100
number2 (optional)Additional ranges
Example: C2:C100

Formula patterns

Examples

1

Calculate total from a vertical range

=SUM(A2:A50)
accountingtotals
2

Summing multiple non-contiguous cells

=SUM(B2, D2, F2)
selectionbasic math
3

Combining a range with a manual constant

=SUM(C2:C10, 500)
adjustmentsfinancials

Avoid these issues

Common Errors

1

#VALUE!

Cause: An individual argument provided directly in the formula is a text string that Excel cannot interpret as a number.

Fix: Reference the cell containing the text within a range (e.g., A2:A5) instead of pointing to it individually, or ensure the argument is a valid number.

2

#REF!

Cause: A cell or range that was previously referenced in the SUM formula has been deleted.

Fix: Click the cell with the error and update the formula to point to a valid existing range, or use Undo if the deletion was accidental.

Platform support

Compatibility

Excel 2007+Excel-first

Source: Microsoft Support

Common questions

Frequently Asked Questions

Adds all numbers in a range of cells.

number1: First number or range to add number2: Additional ranges

#VALUE!: Reference the cell containing the text within a range (e.g., A2:A5) instead of pointing to it individually, or ensure the argument is a valid number. #REF!: Click the cell with the error and update the formula to point to a valid existing range, or use Undo if the deletion was accidental.