599CD.com Back from Vacation   Collapse Menus
 
 
NEW Courses - Excel 2007 Level 4 & 5, Access Security dismiss
 
   
 

What's New?  |  Courses  |  Theater  |  Demo  |  Tips  |  Blog  |  Forums  |  Search  |  Help  |  Order

 
What do you want to learn today? 
 
New Tips Added Weekly. Get Notified of New Tips & Tricks.
 
     
 
Tips & Tricks
   

  Access   Excel   Word   Windows   FrontPage   Hardware   Misc

 
 
Using SUMIF and COUNTIF
 
Q: I've got a spreadsheet of companies, what states they're in, and sales amounts. How can I show just the SUM of sales from all of the companies from a specific state (say NY) only?
   
A: You can use the SUMIF function to add up only those values in a particular range that you want.

Here's a basic example. First I've got a list of numbers. I want to add up the numbers, but ONLY those numbers that are over 40. Let's say I want to count employee work hours, but only those hours for employees who worked 40 hours or more.

 

=SUMIF(B1:B4,">=40")

   
  You can see the SUMIF function takes at least two parameters. The first is the range you're searching in for the "IF" part of the function. The second part is the criteria, which can be a simple inequality like I used here, but it needs to be enclosed in quotation marks. Here I've said, "SUM up the values from B1 to B4, IF the value is greater than or equal to 40." If I press Enter, I get:

 
   
  I get 93 which is correct. Only Alice and Bill should have been added.

Here's an example that answers your question. This one adds up all of the sales, but only from companies from NY:

 

=SUMIF(B1:B7,"NY",C1:C7)
   
  Press Enter I get 3500 which is correct:

 
   
  SUMIF can take a third parameter which is the range you want to add up. If you don't specify it, SUMIF uses the first range. Basically this function adds up all of the values from C1 to C7 where the corresponding entries in B1 to B7 are equal to "NY". See how easy?

Now, there's also a COUNTIF function which is very similar. Instead of adding up the values, however, it just counts them. Try this one:

 

=COUNTIF(A1:A6,"*American*")
   
  In this example I have a list of company names. I want to count all of the names that include the phrase "American" in them. This COUNTIF function says count up all of the entries from A1 to A6 where "American" is found. I included the wildcard characters (the * asterisks) to say that any number of characters can come before and after the search phrase - otherwise it would have looked for just the word American by itself. Press Enter and you'll get 3.

See how easy COUNTIF and SUMIF are?

You can learn about these and many more functions just like them in my Microsoft Excel video tutorials.
   
   

 

Huge Discounts Available
When you purchase multiple classes together
Huge savings up to 50% off! Order Now.
 

You may want to read these articles from the 599CD Blog:

 

 

Need Help
 
Do you have questions about Word, Excel, Access, Web Design, or computers in general? Just ask us anything you'd like. Click here for assistance.
 

Get Free Tips & Tricks
 

Join our mailing list today and get information on our Free Tips & Tricks Newsletter including free video tutorials, eBooks, live seminars, and more.

Email:
Name:
Type in the word to the left:
 
Your email will be kept 100% safe and will never be given to 3rd parties.
 


CLICK HERE for a FREE lesson



Order your first 599CD course now.
Your Satisfaction is Guaranteed!


Subscribe to our RSS FeedWhat's This?

599CD on Facebook  599CD on Twitter  Subscribe to RSS Feed  Add to Live Bookmarks  Add to My AOL  Add to MyYahoo  Add to Google Reader or Homepage    hide help

599CD Home   |   Learn More   |   What's New?   |   Contact Us   |   Free Demo   |   FAQs   |   Order Now   |   Affiliate Program   |   TechHelp   |   MYOLP   |   Jobs   |   Downloads   |   Handbooks  (Text)   |    Mailing List   |   Lost Passwords   |   Referral Program   |   Online Poll   |   Corporate, Educational, Government, Non-Profit Sales   |   Message Forums   |   Testimonials   |   Privacy Policy   |   Free Gift CDs   |   Tips & Tricks