Hiring Partners
Segilola Resources Operating LimitedTaviatech TechnologiesFCMBMTN NigeriaAdvans La Fayette Microfinance BankAboki AfricaFirst Bank of NigeriaOPay
โ† Data Analysis with Excel Functions ยท Lesson 4 of 9

Module Three

๐Ÿ“– Every lesson in this course is free to read right here, no account needed. Create a free account to track your progress, take the exam, and earn your certificate.
4

Module 3: Counting and Conditional Functions in Excel

Module Introduction

Imagine you are a teacher in a secondary school in Ibadan. You have a spreadsheet containing the names and examination scores of 100 students. You want to know how many students passed, how many students have submitted their assignments, and how many students scored at least 70 marks.

Counting and conditional functions in Microsoft Excel can help you answer these questions quickly without counting everything manually.

Learning Objectives

By the end of this module, you should be able to:

  • Explain what counting functions do in Excel.
  • Use COUNT, COUNTA, and COUNTBLANK.
  • Use COUNTIF to count records that meet one condition.
  • Use COUNTIFS to count records that meet multiple conditions.
  • Use the IF function to make simple decisions.
  • Apply these functions to real-life data.

1. Understanding Counting Functions

Counting functions help you find out how many cells contain numbers, information, or empty spaces in a spreadsheet.

For example, a school administrator can use counting functions to find out how many students registered for an examination.

The COUNT Function

The COUNT function counts cells that contain numbers. It does not count text or empty cells.

Example: Imagine these examination scores are stored in cells B2 to B6:

StudentScore
Ade75
Chika90
Tunde65
FatimaAbsent
Emeka85

To count the number of students with numerical scores, enter:

=COUNT(B2:B6)

Result: 4

This is because four cells contain numbers.

The COUNTA Function

COUNTA counts all cells that are not empty. These cells may contain numbers, names, dates, or other text.

Example: To count how many student names are entered in cells A2 to A6, use:

=COUNTA(A2:A6)

Result: 5

It counts all five names because none of the cells is empty.

The COUNTBLANK Function

COUNTBLANK counts the number of empty cells in a selected range.

Example: If some students have not entered their examination scores, you can find the empty score cells with:

=COUNTBLANK(B2:B6)

The function returns the number of empty cells in the selected range.

2. Using the COUNTIF Function

COUNTIF counts cells that meet one condition. A condition is a rule you want Excel to check.

For example, you may want to count students who scored 70 marks or more.

COUNTIF Syntax

=COUNTIF(range, criteria)
  • Range: The cells Excel should check.
  • Criteria: The condition that must be met.

Example: Counting Students Who Scored 70 or More

Assume the scores are stored in cells B2 to B6:

StudentScore
Ade75
Chika90
Tunde65
Fatima55
Emeka85

Enter this formula:

=COUNTIF(B2:B6,">=70")

Result: 3

Excel counts Ade, Chika, and Emeka because their scores are 70 or higher.

Other COUNTIF Examples

  • =COUNTIF(B2:B20,">=50") counts scores of 50 or more.
  • =COUNTIF(B2:B20,"<50") counts scores below 50.
  • =COUNTIF(C2:C20,"Food") counts cells containing the word Food.
  • =COUNTIF(D2:D20,"Pass") counts cells containing Pass.

3. Using the COUNTIFS Function

COUNTIFS is similar to COUNTIF, but it allows you to check more than one condition at the same time.

For example, a teacher may want to count students who belong to JSS 2 and scored at least 70 marks.

COUNTIFS Syntax

=COUNTIFS(criteria_range1, criteria1, criteria_range2, criteria2)

Each criteria range is the group of cells Excel checks, while each criteria is the rule those cells must meet.

Example: Counting Students by Class and Score

StudentClassScore
AdeJSS 280
ChikaJSS 190
TundeJSS 265
FatimaJSS 275
EmekaJSS 385

To count students in JSS 2 who scored at least 70, enter:

=COUNTIFS(B2:B6,"JSS 2",C2:C6,">=70")

Result: 2

Ade and Fatima meet both conditions.

4. Understanding the IF Function

The IF function helps Excel make decisions. It checks whether a condition is true or false and displays a result based on the answer.

Think of it like a teacher checking whether a student has passed an examination.

IF Function Syntax

=IF(logical_test, value_if_true, value_if_false)
  • Logical test: The condition Excel must check.
  • Value if true: What Excel should display when the condition is correct.
  • Value if false: What Excel should display when the condition is not correct.

Example: Checking Students' Results

Assume a student must score at least 50 marks to pass. The student's score is in cell B2.

Enter this formula in cell C2:

=IF(B2>=50,"Pass","Fail")

If the score is 75, Excel displays Pass. If the score is 40, Excel displays Fail.

Example: Applying IF to Several Students

StudentScoreResult
Ade75Pass
Chika90Pass
Tunde35Fail
Fatima45Fail
Emeka85Pass

After entering the formula in C2, drag the small square at the bottom-right corner of the cell downwards to apply it to the other students.

5. Practical Example: Analysing Supermarket Records

Imagine a supermarket in Ibadan wants to analyse its product records.

ProductCategoryQuantity SoldPrice (โ‚ฆ)
RiceFood2050000
BeansFood1530000
SoapHousehold105000
MilkFood1220000
DetergentHousehold87000

Useful Formulas

Count all products with numerical prices:

=COUNT(D2:D6)

Count all products with names entered:

=COUNTA(A2:A6)

Count products in the Food category:

=COUNTIF(B2:B6,"Food")

Count products in the Food category with a price of at least โ‚ฆ20,000:

=COUNTIFS(B2:B6,"Food",D2:D6,">=20000")

Classify a product as Expensive or Affordable:

=IF(D2>=20000,"Expensive","Affordable")

6. Common Mistakes to Avoid

  • Using COUNT when you want to count names or other text. Use COUNTA instead.
  • Forgetting quotation marks around text criteria such as "Food".
  • Leaving out quotation marks around comparison criteria such as ">=70".
  • Selecting the wrong cell range.
  • Forgetting one of the conditions in a COUNTIFS formula.
  • Leaving out a comma or bracket in an IF formula.

Note: Some Excel regional settings use semicolons instead of commas to separate formula arguments. If a formula gives an error, check your Excel settings.

7. Practical Exercise

A school in Lagos has recorded the examination scores of five students. Enter the information into Excel and answer the questions below.

StudentClassScore
DavidJSS 165
MaryJSS 285
JohnJSS 145
GraceJSS 270
PeterJSS 390

Your Tasks

  1. Use COUNT to count the number of numerical scores.
  2. Use COUNTA to count the student names.
  3. Use COUNTIF to count students who scored at least 70.
  4. Use COUNTIFS to count JSS 2 students who scored at least 70.
  5. Use IF to display Pass for scores of 50 or more and Fail for scores below 50.

Module Summary

In this module, you learned how to use Excel counting and conditional functions.

  • COUNT: Counts cells containing numbers.
  • COUNTA: Counts cells that are not empty.
  • COUNTBLANK: Counts empty cells.
  • COUNTIF: Counts cells that meet one condition.
  • COUNTIFS: Counts records that meet multiple conditions.
  • IF: Makes decisions based on a condition.

These functions make it easier to analyse school records, supermarket sales, business information, and other types of data.

What Is Next?

In Module 4, you will learn about Logical Functions in Excel, including AND, OR, and NOT. These functions will help you check multiple conditions and make more advanced decisions using spreadsheet data.

๐Ÿ† Get Certified

๐Ÿ”’

Earn this certificate

Every lesson is already free to read. Sign up, finish the lessons, pass the exam (โ‚ฆ2,000 or 20,000 coins), and get a verified certificate with your name on it.

๐ŸŽ“ Sign Up to Get Certified
๐Ÿ› ๏ธ Practice Tools
Hands-on simulators & labs - subscription required.
โ†’
๐ŸŽฏ Internship Tasks
Real-world tasks to build your portfolio - unlock them with a subscription.
โ†’