Skip to main content

The Excel SUM Function

 - In earlier parts of this course, you used addition formula quite a lot. You saw that the basic way to add things up was by doing this:
=A1 + B1 + C1
You've also used the in-built SUM function:
=SUM(A1:C1)
Whichever of these two you used, the answer was the same - Excel will add up whatever numbers you have in the cells A1, B1, and C1. The two methods above are adding up consecutive cells. But what if you want to add up the following, non-consecutive cells: A1, B1, C1, D9?
Well, you can combine the two methods. So you can do it like this:
= Sum(A1:C1) + D9
or you can do it like this:
= Sum(A1:C1, D9)
For the first method, just type a plus sign after your SUM function, followed by the cell you want to include:
= Sum(A1:C1) + D9
You can include as many other cells as you like:
= Sum(A1:C1) + D9 + E12 + G25
You can even use another SUM function:
= Sum(A1:C1) + SUM(G1:H1)
But you are just telling Excel which cells in your spreadsheet that you want to include in your addition formula.
The second method to add up non-consecutive cells starts in the same way: use a SUM function, and separate your consecutive cells with a colon:
= Sum(A1:C1)
To include the non consecutive cells, type a comma, followed by the cell you want to include:
= Sum(A1:C1, D9)
You can include other cells, as well:
= Sum(A1:C1, D9, E12, G25)
The thing to note is that all the cells are between the round brackets of the SUM function. Excel knows that SUM means to add up, so it sees each cell reference separated by commas, and then includes them in the addition.
To give you some practice, try this exercise.
Exercise
Create a simple spreadsheet with the number 3 in cells A1, B1, C1 and D1. Enter another number 3 in cell A2. Use one of the non consecutive addition formulas above to add up the values in all five cells. Your spreadsheet will then look like this, once you have the correct formula:
Use Excel 2007 to create this spreadsheet
In the picture above, cell A4 displays the correct answer.

Selecting Non Consecutive Cells

Another way to select non-consecutive cells for your SUM functions is by holding down the CTRL key on your keyboard, and then left click in the cell you want to add. Try this:
  • Click inside a different cell in your spreadsheet (B4, for example). Then click inside the formula bar at the top
  • Now type the following into the formula bar (Don't forget to add the colon at the end):
=SUM(A1:
  • The cell A1 will be highlighted on the spreadsheet. It will have sizing handles, so that you can stretch the selection
  • Hold your left mouse button over the bottom right blue square, and drag to cell D1. You spreadsheet should look like this:
Highlight the cells A1 to D1 in your Excel spreadsheet
Excel will add the cells to your formula. But it will also add a colon after D2. We don't want this, because a colon means "add up a range of cells". So delete the colon and type a comma instead.
Now that you have the cells A1 to D1 selected, hold down the left CTRL key on your keyboard. Keep it held down, and click inside cell A2 with your left mouse button:
Select a new cell
The cell A2 is highlighted, in the image above. Excel will add this to your formula.. To finish off, add the right bracket ). Then press the enter key on your keyboard.
Using this method, you can add as many individual cells as you want for your formula.

Exercise
On a new sheet, enter the number 3 in the following cells: A1, B1, C1, D1, E1. Then type a 3 in the cells A3, C3 and E3. Using non-consecutive addition, display your answer in cell A5. The finished spreadsheet will then look like ours below:
An Excel 2007 Exercise
The answer to the addition, 24, is displayed in A5. Only one Sum function was used here, with the other cells separated by commas.

Adding up shouldn't cause you too many problems. The tricky part is selecting all the cells that you want to include. In the next part, we'll at multiplication.

Comments

Popular posts from this blog

Beginners PHP  -This is a complete and free PHP programming course for beginners. It's assumed that you already have some HTML skills. But you don't need to be a guru, by any means. If you need a refresher on HTML, then click the link for the Web Design course on the left of this page. Everything you need to get started with this PHP course is set out in section one below. Good luck! Home Page > PHP Section One - An Introduction to PHP 1. What is PHP and Why do I need it? 2. What you need to get started 3. Installing and testing Wampserver 4. Troubleshooting > PHP Two - Getting Started With Variables 1. What is a Variable? 2. Putting text into variables 3. Variables - some practice 4. More variable practice 5. Joining direct text and variable data 6. Adding up in PHP 7. Subtraction 8. Multiplication 9. Division 10. Floating point numbers > PHP Three - Conditional Logic 1. If Statements 2. Using If Statements 3....
Visual Basic .NET Contents Page   -This computer course is an introduction to Visual Basic.NET programming for beginners. This course assumes that you have no programming experience whatsoever. It's a lot easier than you think, and can be a very rewarding hobby! You don't need to buy any software for this course! You can use the new FREE Visual Basic Express Edition from Microsoft. To see which version you need, click below: Getting the free Visual Studio Express - Which version do I need? > VB .NET One - Getting Started   1. Getting started with VB.NET 2. Visual Basic .NET Forms 3. Adding Controls using the Toolbox Home Page 4. Adding a Textbox to the Form 5. Visual Basic .NET and Properties 6. The Text Property 7. Adding a splash of colour 8. Saving your work 9. Create a New Project >   VB .NET Two - Write your first .NET code   1. What is a Variable? 2. Add a coding button to the Form 3. Writing y...
The Excel SumIF Function  - Another useful Excel function is SumIF. This function is like CountIf, except it adds one more argument: SUMIF( range ,  criteria ,  sum_range ) Range and criteria are the same as with  CountIF  - the range of cells to search, and what you want Excel to look for. The Sum_Range is like range, but it searches a new range of cells. To clarify all that, here's what we'll use SumIF for. (Start a new spreadsheet for this.) Five people have ordered goods from us. Some have paid us, but some haven't. The five people are Elisa, Kelly, Steven, Euan, and Holly. We'll use SumIF to calculate how much in total has been paid to us, and how much is still owed. So in Column A, enter the names: In Column B enter how much each person owes: In Column C, enter TRUE or FALSE values. TRUE means they have paid up, and FALSE means they haven't: Add two more labels: Total Paid, and Still Owed. Your spreadsheet should look something li...