Microsoft Excel - Sumifs formula

Asked By Leigh Thomas
11-Feb-12 01:53 PM
Hi pichart y
thank you for your help here's the file

thanks
Leigh

LeighThomas.zip
  Somesh Yadav replied to Leigh Thomas
12-Feb-12 03:36 AM
earning the SUMIF formula extends the capabilities of the basic SUM formula by allowing you to tell Excel to only SUM items that meet a certain criteria.  Whilst the SUMIFS is new in Excel 2007, it allows you to stipulate multiple criteria, hence the plural.

Enough explanation, let’s dive into an example as it’s easier to visualise.

SUMIF Formula first:

The function wizard in Excel describes the SUMIF Formula as:

=SUMIF(range,criteria,sum_range)

Not very helpful is it?  Let’s translate it into English with an example.  In the table below we want to sum the total number of Units (in column D) for Dave:

Excel-SUMIF-and-SUMIFS-Formulas-explained

Translated, our formula would read like this:

=SUMIF(the name in column C, = Dave, add the figures in column D)

We could even put a summary table at the bottom of the list for each builder like this:

Our formula in cell D11 would be:

=SUMIF(C2:C7,”Dave”,D2:D7)

While the above formula is good, if we were to copy it to the rest of the summary table (cells D11 to D14 and F11 to F14) we would have to manually change the cell references and builder’s name to get the correct answers.

The solution is to use absolute references to help speed up the process of copying the formula to the remainder of column D and column F.  With absolute references our formula would look like this:

=SUMIF($C$2:$C$7,$C11,D$2:D$7)

We could then copy and paste the formula to the remaining cells in our summary table without having to modify it at all.  As we copied it down column D, Excel would dynamically update the formula to automatically pick up the next builder in the list.  Then when we copied it across to column F, Excel would dynamically alter the reference to column D to F.

The best way to fully understand this conundrum is to try it for yourself.  Download the workbook used in this example here for practice.

Note: I used a basic example to illustrate how to use the SUMIF formula, but you can also achieve this using the subtotal tool in the Data tab.  But that’s a lesson for another day!

SUMIFS Formula:

The function wizard in Excel describes the SUMIF Formula as:

=SUMIFS(sum_range,critera_range_1,criteria_1,criteria_range_2,criteria_2…..and so on if required)

Extending the SUMIF example above, say we wanted to only summarise the data by builder, for jobs in the central region.  We could use the SUMIFS formula as it allows us to set more than one condition.

Here’s how the formula would be interpreted if we wanted to add up the Units in column D, for Doug’s jobs in the Central region:

=SUMIFS(add the units in column D if, in column C, they are for Doug and, if in column B, they are also for the Central region)

Note: Excel will only include the figures in column D in the sum when both conditions (Doug & Central) are met.

In Excel our formula would read:

=SUMIFS(D$2:D$7,$C$2:$C$7,$C18,$B$2:$B$7,$B$17)

Excel-SUMIF-and-SUMIFS-Formulas-explained

Note: again I’ve used a simple example to illustrate this formula, but you could also achieve this summary table for each builder by region using Pivot Tables. To watch a tutorial on how to insert a Pivot Table sign up to our Premium Microsoft Office Online Training or read our Pivot Table Tutorial.

Try other operators in your SUMIF and SUMIFS

Just like the IF formula, the SUMIF and SUMIFS are based on logic.  This means you can employ different tests other than the text matching (Doug & Central) we’ve used above.

Other operators you could use are:

  • =         Equal to
  • <         Less Than
  • <=       Less than or equal to
  • >=       Greater than or equal to
  • <>       Less than or greater than

For example, if you wanted to sum units greater than 5 the formula would be:

=SUMIF($D$2:$D$7,”>5”,$D$2:$D$7)

  Leigh Thomas replied to Somesh Yadav
12-Feb-12 08:41 AM
thank you for your reply, i have tried to consolidate the data from over 50 sheets is the problem excel is having,
what i have now done is returned individual values for each sheet on the result sheet then used a simple sum formula to pull them into the result cell i wanted

Leigh
  Donald Ross replied to Leigh Thomas
12-Feb-12 04:12 PM
Leigh,

I am glad you have made progress with help from Eggheadcafe, and its members.
I would like to offer one more suggestion for you to look at in the future.

There is a feature called a Pivot Table.  it is a very powerfull tool It normally only looks at one sheet of data and the formula bar and ribbon only allow for one.  but you can use ALT+D, P to get to the multiable sheet wizard.

I looked for a tutoral for you and this is one of the easy ones to follow.
http://www.youtube.com/watch?v=ZBn1-r0I5oE

HTH and thanks again for posting.

Don
  Leigh Thomas replied to Donald Ross
13-Feb-12 07:50 AM
hi don,
thanks for your post im going to give it a go i didnt know you could pull so easily from different sheets

thank you

Leigh
  Donald Ross replied to Leigh Thomas
13-Feb-12 06:58 PM
When you get a chance, let me know how you did with the Pivot table.

Don
Create New Account
help
Deleating All Selected Data Excel 2007 Excel Excel 2007 (What worked for Excel 2003 makes 2007 crash). I have run Microsoft Office Diagnostics and it can not identify any problems) When I try to delete data
Enregistrer dbf sous excel 2007 Excel Bonjour la Communaut??, Comment r??ussir ?? enregistrer un format dbf sous excel 2007? Merci pour vos conseils Bernie Excel - French Discussions Microsoft Excel (1) Excel 2003 (1) Excel 2007 (1) DBASE (1) Enregistrer (1) Communaut (1) Conseils (1
What are the differences between excel 2000 & excel 2007? Excel We're trying to decide if it would be beneficial to upgrade from excel 2000 to excel 2007. What are the differences between excel 2000 & excel 2007? Excel Miscellaneous Discussions Microsoft Excel (1) Excel 2007 (1) BA597438D5D2 (1) Previews
Conflict with Valid Range Reference Error in Microsoft Excel 2007 Excel Hi, While converting the Macros enabled Microsoft Excel 2003 to Microsoft Excel 2007 format, I am getting the following Conflict with Valid Range Reference Error. After clicking
SQL plus de Inclure les noms de champ dans SQL EXcel 2007 Excel Bonjour, Nous venons de miger de Microsoft Excel 2003 vers Microsoft Excel 2007. Dans la version Excel 2003, on avait avec clic droit sur une plage de donnÃ