Skip to main content

The SUM Function Continued

  - Using the same spreadsheet you've been working on in the previous section, you'll now get some more practice with the SUM function in Excel, in order to add up values in cells. Our spreadsheet now looks like this, though:
Our Excel 2007 Spreadsheet


You've just used the easy way to add up values in consecutive cells for a column. Just do this:
=SUM(B4:B7)
Using that formula gave us the answer to how many chocolate bars we ate from Monday to Sunday. You can use this same colon ( : ) shorthand to add up numbers in a Row.
  • Click inside cell J3 of your Chocolate Addiction spreadsheet
  • Type the text Individual Totals (you may have to widen the column a bit, as you did for a previous section)
  • Your spreadsheet will then look like this:
A new label has been added  in the J Column
We'll use a SUM formula to add up the values in each Row. This will tell us how many of a particular chocolate bar we ate in one week: how many Mars Bars, how many Twix, etc.
The first answer we'll try is how many Mars Bars we ate in one week. We'll place this answer in cell J4. The cells we're going to be adding up are these:
B4 + C4 + D4 + E4 + F4 + G4 + H4
Because we have consecutive cells, we can use the colon shorthand again.
  • Click into cell J4 of your spreadsheet
  • Then click into the formula bar at the top
  • Enter the following formula:
=Sum(B4:H4)
Press the enter key on your keyboard, and you'll see the answer appear in J4. To complete the rest of the rows, we can use AutoFill again.
  • Click back in cell J4 to make it the active cell
  • Move your mouse pointer to the bottom right of cell J4
  • You'll see the pointer change to a thin black cross:
The AutoFill Cursor
  • Now hold down your left mouse button
  • Keep the left button held down and drag down to cell J7
Drag to cell J7
When your mouse pointer gets to cell J7, let go of the left button. Excel will use AutoFill to get the answers for the other three cells. Hopefully, your spreadsheet now looks like ours:
The J column has now been AutoFilled
Select any of the cells J4, J5, J6 and J7. Then examine the formula in the formula bar. You should be able to understand what is being added up, and what all the formulas mean.
Now that we have totals for each individual chocolate bar, we can work out how many chocolate bars we ate for the whole week. We'll put the Grand Total in cell F11. First, we'll enter some text to explain what is being added up
  • Click inside cell A11 on your spreadsheet
  • Type the following text: Number of Chocolate bars consumed in a week
  • Hit the Enter key on your keyboard
  • You should see the text you just typed. But it will all be in individual cells. Highlight the cells A11 to E11, and merge them together (You learned how to merge cells in a previous section.)
  • This is what your spreadsheet should now look like:
A Merged Heading in cell A11
There are two ways we can calculate the Grand Total. You can just add up the Individual totals in the J column, or ... Well, how else could you get the number of chocolate bars consumed in one week?
  • Click into cell F11 on your spreadsheet
  • Enter your formula to calculate the number of chocolate bars consumed in one week
  • Hit the Enter key when you think you have the correct formula
The correct answer is 80. If you got a different answer, or are struggling in any way to come up with the correct formula, then it's a good idea to go over the previous section. But don't just type 80 into cell F11 and move on!

In the next part, we'll extend the spreadsheet a little. To do that, you learn how to copy and paste with Excel

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...