Skip to main content

The Excel SumIF Function

 - Another useful Excel function is SumIF. This function is like CountIf, except it adds one more argument:
SUMIF(rangecriteriasum_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:
Create the following Excel 2007 Spreadsheet
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 like this one:
In cells B10 and B11, we'll use a SumIF function to work out how much has been paid in, and how much is still owed. Here's the SumIF function again:
SUMIF(rangecriteriasum_range)
So the range of cells that we want to check are the True and False values in the C column; the criteria is whether they have paid (True); and the Sum_Range is what we want to add up (in the B column).
In cell B10, then, enter the following formula:
=SUMIF(C3:C7TRUEB3:B7)
When you press the enter key, Excel should give you the answer:
So 265 is has been paid in. But we told SumIF to first check the values in the cells C3 to C7 (range). Then we said look for a value of TRUE (criteria). Finally, we wanted the values in the B column adding up, if a criteria of TRUE was indeed found (sum_range).
Exercise
Use SumIF to work out how much is still owed. Put your answer in cell B11.

We'll leave the subject of Conditional Logic. In the next section, more things you can do 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....
How to change your Windows XP Desktop Wallpaper - Wallpapers are images that appear in the background on your Desktop, behind all your icons. To change your Desktop wallpaper, do the following: Click anywhere on the Desktop that is not an icon, but click once with your right hand mouse button A menu pops up. The one below Click on  Properties , once with your Left mouse button The following dialogue box pops up This is the Display Properties dialogue box. As you can see, there are tab strips for Themes, Desktop, Screensaver, Appearance, and Settings. Click on the Background tab strip and the dialogue box will change to this one: There is a list of wallpapers we can use. Click on one, and you get a preview of what it will look like. Scroll down to see more wallpapers. If you're satisfied, click the OK button to set your wallpaper. You can use your own images. You are not limited to the ones on the list. If you have an image somewhere on your compute...
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...