Uma needs to help the sales department to find out a breakdown of orders coming from the states of Victoria, New South Wales, and Western Australia. Uma already has a dashboard template from last year, which she now needs to fill in, this template is on the next sheet. So click on the next sheet, sales dash, where we'll be summarizing our data. We would like Excel to count cells in a range, but this time only if cells in that range meet certain criteria. COUNTIFS is the function to help us with the job at hand. First up, we are going to work out the number of orders in each of the three states that Uma wants, which are abbreviated as VIC, NSW, and WA in our database. It's important to use the plural version COUNTIFS if you have it, if you don't, the singular version COUNTIF is okay for today. Tab to choose COUNTIFS, the COUNTIFS function consists of at least two arguments, the range, and the criteria and we want to apply. Firstly, we need to define the range, which is where the function will find the information you're looking for. In our example, this is the state column in the first sheet. Again, we can see how useful the name ranges that we created in week three are. Without the name ranges, this process would be much more complicated. Now a comma to separate the two arguments, and then we supply the criteria based on which Excel will decide whether or not to count the cell. In our case, these are the names of the state, let's start with VIC, so just click on cell A5 and press Enter. What Excel has done is counted all the cells that contain the value VIC within our named range state in the previous sheet. Double click on the fill handle in cell B5 to do this for the other two states. You'll notice that there's a live pie chart in this dashboard, that got updated as we worked through the COUNTIFS. The calculations we have done show us that there are 289 orders for the state of VIC, 646 orders for the state of NSW, and 104 orders for the state of WA. Next up, we need to figure out how many orders per customer type, we can use COUNTIFS to work this out as well. Click on cell B11, type equals COUNT, arrow down all the way to select COUNTIFS, Tab. First is the range to select the customer type, down arrow, Tab to select that name range from the previous sheet. Comma to specify the next argument, which is the criteria, which is home office in cell A11, and Enter. Double click on the fill handle in cell B11 to do this for all the different customer types, again, we have a live pie chart on this dashboard. The next thing to complete Uma's dashboard is to work out the number of orders with quantities over 40. Much the same as the previous two, with one small modification. The criteria that defines which cells will be counted can be in the form of a cell reference as we did before. It can be a number, or the criteria can be text, or even an expression. For COUNTIFS, text and expressions must be within quotation marks. So greater than 40, which is an expression, must be entered within quotation marks. Click on cell B16, type =COUNT, arrow down and Tab, specify the range, which is Order_Quantity, and Tab. Comma to specify the next argument, which is the criteria, >40 is an expression, so that goes within quotation marks, and Enter. There are 238 orders which have a quantity over 40. We have looked at how to use COUNTIFS to summarize large amounts of data, by counting the number of times a criteria is met in a range. In the next video, we will look at the SUMIFS function, which allows us to sum ranges that meet specified criteria.