Category: FUNCTION | Updated: 2026-11-20

How to Use the SUM Function in Google Sheets | Basic Function to Add Numbers in a Range

How to Use the SUM Function

The SUM function is the most basic aggregation function in Google Sheets, calculating the total of a specified cell range or numeric values.

Syntax

=SUM(value1, [value2, ...])
  • value1: Specify the first number, cell reference, or cell range (e.g., A2:A10) to add together (required).
  • value2, …: Additional numbers or cell ranges to add, separated by commas (optional).

Practical Example with Table

Here is an example of calculating total product sales from the sales table below.

Row Column A (Product Name) Column B (Sales Amount)
1 Product Name Sales Amount
2 Laptop 120,000
3 Monitor 35,000
4 Keyboard 12,000
5 Mouse 4,500
6 Total =SUM(B2:B5)
  • Formula: =SUM(B2:B5)
  • Result: 171,500

If you want to include non-adjacent cells, specify them like =SUM(B2, B4) (result: 132,000).

Common Errors and Notes

  • Numbers stored as text are ignored: Strings enclosed in double quotes like "1000" or numbers formatted as “Plain text” are excluded from the calculation and ignored.
  • Watch out for circular reference errors (#REF!): If you include the cell displaying the total within the sum range itself (e.g., entering =SUM(B2:B6) in cell B6), a circular reference occurs and produces a #REF! error.
  • Effect of error values within the range: If any cell in the specified range contains an error such as #N/A or #VALUE!, the SUM function will also return that error. To sum while excluding errors, use functions like SUMIF or AGGREGATE.

Frequently Asked Questions

Q. How can I sum multiple non-adjacent cells with the SUM function?

A. Separate the references with commas (,). For example, writing `=SUM(A2:A5, C2:C5, E2)` lets you sum non-contiguous ranges and individual cells together.

Q. Why does the SUM function return 0?

A. The numbers in the target cells are likely recognized as text strings. Change the cell number format to 'Automatic' or 'Number', or re-enter the values as numbers.