how to use the countif and sumif functions in excel

Upload: cialee

Post on 04-Jun-2018

238 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 How to Use the COUNTIF and SUMIF Functions in Excel

    1/11

  • 8/13/2019 How to Use the COUNTIF and SUMIF Functions in Excel

    2/11

    2

    Next, well type in the countif function. As you can see, countif takes two inputs, therange youre interested in and the criteria that need to be met:

    In our case, the data (store type) is in column B, so we input that into the first part ofthe countif function:

    http://www.experiglot.com/wp-content/uploads/2010/01/countif1.pnghttp://www.experiglot.com/wp-content/uploads/2010/01/data2.png
  • 8/13/2019 How to Use the COUNTIF and SUMIF Functions in Excel

    3/11

    3

    Next, we want each entry to be counted only if the type of sale was store, or whatweve typed into cell E2:

    http://www.experiglot.com/wp-content/uploads/2010/01/countif3.pnghttp://www.experiglot.com/wp-content/uploads/2010/01/countif2.png
  • 8/13/2019 How to Use the COUNTIF and SUMIF Functions in Excel

    4/11

    4

    Note that if we hadnt typed in store in E2, we could type it directly into the functionlike this:

    =countif(B2:B20, store)

    By the way, remember to always put quotation marks () around the criteria whenworking with text!

    Either way, once we close the parenthesis and hit, we immediately get the result. Therewere 7 sales from 2003-2009 that took place at the store (one for each year).

    Repeating the same thing for telephone:

    http://www.experiglot.com/wp-content/uploads/2010/01/countif5.pnghttp://www.experiglot.com/wp-content/uploads/2010/01/countif4.png
  • 8/13/2019 How to Use the COUNTIF and SUMIF Functions in Excel

    5/11

    5

    We find the same result 7 sales. Now lets check online:

    Turns out we had less online sales (maybe because we didnt launch a website thataccepted sales until 2005):

    http://www.experiglot.com/wp-content/uploads/2010/01/countif7.pnghttp://www.experiglot.com/wp-content/uploads/2010/01/countif6.png
  • 8/13/2019 How to Use the COUNTIF and SUMIF Functions in Excel

    6/11

  • 8/13/2019 How to Use the COUNTIF and SUMIF Functions in Excel

    7/11

    7

    The second input is the criteria, which in this case is also identical to what we put in forcountif above:

    But sumif also takes one additional argument: the range to be summed. In this case, wewant to know the total number of sales, which is in column C:

    http://www.experiglot.com/wp-content/uploads/2010/01/sumif4.pnghttp://www.experiglot.com/wp-content/uploads/2010/01/sumif3.png
  • 8/13/2019 How to Use the COUNTIF and SUMIF Functions in Excel

    8/11

    8

    Closing out the parenthesis, we find that we had 211 total sales in the store from 2003-

    2009:

    Again, lets repeat the same thing to find the total number of telephone sales:

    http://www.experiglot.com/wp-content/uploads/2010/01/sumif6.pnghttp://www.experiglot.com/wp-content/uploads/2010/01/sumif5.png
  • 8/13/2019 How to Use the COUNTIF and SUMIF Functions in Excel

    9/11

    9

    and online sales:

    See the difference between what countif gives and what sumif gives?

    Note that sumif can also take in different criteria. Lets suppose we wanted to know thetotal number of sales that have taken place starting in 2008, regardless of type. To dothis, we could make our range the year, found in column A:

    http://www.experiglot.com/wp-content/uploads/2010/01/sumif8.pnghttp://www.experiglot.com/wp-content/uploads/2010/01/sumif7.png
  • 8/13/2019 How to Use the COUNTIF and SUMIF Functions in Excel

    10/11

    10

    and then add in the criteria of >= 2008:

    Finally, we again want to sum up the total number of sales, which is in column C:

    Closing out our final parenthesis, we get that we have had a total of 141 sales from

    2008-2009:

    http://www.experiglot.com/wp-content/uploads/2010/01/sumif10.pnghttp://www.experiglot.com/wp-content/uploads/2010/01/sumif9.png
  • 8/13/2019 How to Use the COUNTIF and SUMIF Functions in Excel

    11/11

    11

    Finally, just a quick example here will show what happens if you put in non-numericaldata to sum using the sumif function. Lets change the number of store sales in 2008from 37to nonsense and see what happens:

    Notice how the calculations automatically ignore that entry, and the total number of storesales and the total number of sales since 2008 both drop by 37.

    Thats it for now. A quick intro tutorial to using countif and sumif. Like most other Excelfunctions, these can get as complicated as youd like (at the expense of readability), soalways try to keep it as simple as possible.

    http://www.experiglot.com/wp-content/uploads/2010/01/sumif12.pnghttp://www.experiglot.com/wp-content/uploads/2010/01/sumif11.png