Skip to main content

Using the CountIF Function in Microsoft Excel

  - The next Conditional function we're going to use is CountIF. This one is fairly straightforward. It looks at a range of cells and tells you how many of them meet the criteria that you set. Once again, we'll use the student exam marks spreadsheet.

Copying and Pasting Data to a new Sheet

Open up the Spreadsheet you used for the last section. (If you haven't yet downloaded the spreadsheet, click here: Download the spreadsheet.)
Because the exam spreadsheet might be a little full, we'll start on a new sheet. We'll copy and paste the student data onto sheet 2. To do that, follow these steps:
  • Highlight the data you want to copy
  • For us, that's the student data, as in the image below:
Highlight the data in your spreadsheet
  • With the data highlighted, click on Edit from the menu bar
  • From the drop down list, click on Copy. The marching ants surround your highlighted data
  • Look at the bottom of the spreadsheet and locate Sheet2, as in the next image:
Click on Sheet2
  • Click on Sheet2 with your left mouse button
  • The blank Sheet2 spreadsheet should appear
  • Click inside cell A1
  • Press the Return key on your keyboard to paste the data (Or click Edit > Paste from the Excel menu bar)
Add the following labels to Sheet2 of your spreadsheet:
We'll now use the CountIF function to see how many of the students were above a score of 70 in each subject.

CountIF
The CountIf function only calculates things when a certain condition is met. For example, only count the students whose grades are above B.
The CountIF function uses this syntax:
COUNTIF(rangecriteria)
In other words, it takes two arguments. The first argument is range, and this means the range of cells you want to count. The criteria is what you want excel to look for when it is counting. Let's see it in action.
  • Click inside cell B15
  • Click inside the formula bar
  • Enter the following function:
=CountIf(B2:I2">= 70")
  • Press the return key on your keyboard
  • The answer you should have got was 4
The formula says, look in cells B2 to I2. Then check for a score of greater than or equal to 70. If you find this score, keep a Count.
So 4 students achieved a mark of 70 or above for Maths. To do the rest of the scores, you can use AutoFill. When you have finished, it should look like this one below:
CountIF is a very useful function for simple data analysis.

In the next part, we'll take a look at two more useful functions: AND and SUMIF.

Comments

Popular posts from this blog

PRATYUSHA HOME

Hi interesting readers, Prathysha NGO, Chennai. Bala gurukul orphange, chennai. Pratyusha support, Hyderbad. Krr oldage home, Vizag. Disa foundation.......................................................... so on..................... Join hands with us for a good cause. Thank you all. Contact  us on our  whatsapp no:  8939374254    for the more details. You can pay through Paytm scanner. for each donor we will give an online PDF book as a gift. Thank you Pratyusha Home
Javascript Tutorials for the Beginner - Welcome to the Home and Learn course for Javascript. Although it is aimed at complete beginners to the subject we do assume that you have some knowledge of HTML and a little CSS. You don't have to be an expert, though. Just the basics will do. (If you're not sure about the HTML then see our Web Design course.) You don't need to buy any software for this Javascript course - you probably already have everything you need to get started.   > Section One: Getting Started 1. Software needed 2. Our Javascript Templates 3. A little word about debugging Home Page > Section Two: The Browser 1. A First Script 2. Javascript Tag Placement 3. The Browser Object Model 4. Browser Window Methods 5. The Document Object Model > Section Three: Javascript Programming Basics 1. Javascript Variables 2. Math Operators 3. Operator Precedence 4. IF Statements 5. IF ... Else 6. Comparison Operators 7...
Sorting Images in Windows 7  -In the previous section, you learned how to add information to an image. In this section, you'll se what you can do with all this information. This comes under the topic of Sorting. First, though, change your View slider from  Tiles  to  Details : When you arrange the window to Details view, your screen should look like this one: We now have a list of images with the Name, Date, Tags, Size and Ratings showing. These headings can all be used to sort your images. Click on the Ratings, for example, and you'll see a dropdown box: You can choose to display only images with 1, 2, 3, 4 or 5 stars. All you need to do is to check each box. The ones not checked will then be hidden: Here, we're choosing to display only 1 and 2 star images, perhaps with a view to deleting them. (To delete an image, right-click. From the menu that appears, select  Delete . Or choose  Rename  to change the name of the image....