Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Last Updated: Mar 27, 2024
Difficulty: Easy

The Sum Function

Leveraging ChatGPT - GenAI as a Microsoft Data Expert
Speaker
Prerita Agarwal
Data Specialist @
23 Jul, 2024 @ 01:30 PM

Introduction

The count and sum functions are the most commonly used functions in Excel. You can count and sum numbers using multiple criteria.

SUM

To sum a range of cells, a complete column, or non-contiguous columns in Excel, use the SUM function. Combine the SUM function with other Excel functions to generate amazing SUM formulas.

Most of the time, you will use the SUM function to sum a range of cells in 

Excel.

In Excel, the SUM function adds the numerical values in a range of cells. Type "=SUM" followed by the data to be summed. It is categorized under the Maths and Trigonometry function. Numbers, cell references, and ranges can all be used as input to the function.

For example, 

cells A1, A2, and A3 contain 200, 400, and 600, respectively. The formula “ = SUM(A1:A3) ” adds the numbers of the cells A1 to A3. It returns 1200.

=SUM(A1:A3)

 

 

NOTE: The SUM formula immediately adjusts when a value is added or removed. Changes to an existing cell range are also included. In addition, the function ignores empty cells and text values.

Syntax of the SUM Excel Function

number1: The first numerical value to be added.

number2: The second numerical value to be added and so on.

The argument “number1” is required, whereas the following numbers (“number 2”, “number 3”, etc.) are optional.

The number of ways to Enter the SUM Function in Excel

1. Write Manually

Type "=SUM" followed by the inputs to manually enter the SUM function.

2. Using the “math & trig” option

  • Click the “math & trig” option in the Formulas tab.
  • From the drop-down menu, select the SUM option as shown below.

 

  • Enter the SUM function arguments in the "function arguments" dialogue box.
  • To get the output, click "Ok."

 

AutoSum

The fastest approach to add numbers in a range of cells is to use the AutoSum option. In the selected cell, it automatically enters the SUM formula.

  1. Select the blank cell immediately following the cell to be summed up. Select cell A4.
  2. Click "AutoSum" in the Home tab. Alternatively, hit the shortcut keys " Alt + = " simultaneously.

1. In the selected cell, the SUM formula appears. It displays the cell references that have been summed up.

2. Press Enter.

Get the tech career you deserve, faster!
Connect with our expert counsellors to understand how to hack your way to success
User rating 4.7/5
1:1 doubt support
95% placement record
Akash Pal
Senior Software Engineer
326% Hike After Job Bootcamp
Himanshu Gusain
Programmer Analyst
32 LPA After Job Bootcamp
After Job
Bootcamp

Types of SUM Function in Excel

Sum

To add a range of cells, use the SUM function as shown above.

Sumif

Use the SUMIF function(two arguments) to sum cells based on a single criterion.

For example, sum the numbers from A1 to A3, which are greater than 300).

=SUMIF(A1:A3, “>300”)

 

Sumifs

Use the SUMIFS function to sum cells based on multiple criteria.

For example, Let’s add numbers with a circular shape and red-colored. 

The first argument will be the range to sum(The C column).

=SUMIFS(C1:C4, A1:A4, “Circular”, B1:B4, “Red”)

 

Examples

  1. The SUM function can also be used to add an entire column or row.

For example, to sum the entire column A, use the formula-

=SUM(A: A)

 

2. Sum Non-contiguous Cells

To sum non-contiguous cells of a column, use any following formulas.

=SUM(A1, A3, A5)

OR

=SUM(A1+A3+A5)

 

FAQs

1. What is the SUM function in Excel?

In Excel, the SUM function adds the numerical values in a range of cells. It is entered by typing "=SUM" followed by the data to be summed. It is categorized under the Math and Trigonometry function. Numbers, cell references, and ranges can all be used as input to the function.

Key Takeaways

In this article, we learned about the SUM function in Excel. We learned to use the SUM function by adding manually or using the Formula toolbar.

We also learned about AUTOSUM, SUMIF, and SUMIFS functions.

Then we saw a few examples of using the SUM function to add,

  1. Numbers in a range of cells.
  2. To add an entire column or row.
  3. To add non-continuous cells.

EXPLORE MORE!

Check out this problem - Two Sum Problem

You can use Coding Ninjas Studio to practice various DSA questions asked in different interviews. It will help you master effective coding techniques, and you will also get interview experiences from people working in big companies.

Topics covered
1.
Introduction
2.
SUM
2.1.
Syntax of the SUM Excel Function
2.2.
The number of ways to Enter the SUM Function in Excel
2.3.
AutoSum
3.
Types of SUM Function in Excel
3.1.
Sum
3.2.
Sumif
3.3.
Sumifs
4.
Examples
5.
FAQs
6.
Key Takeaways