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

Module Eight

๐Ÿ“– 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.
9

Module 8: Statistical and Conditional Calculation Functions in Excel

Module Introduction

In previous modules, we learned how to use Excel functions to calculate totals, averages, count records, and find information. In this module, we will learn how to calculate totals and averages based on certain conditions.

Imagine you own a supermarket in Ibadan. You sell rice, beans, milk, bread, and other products. You may want to calculate only the total sales of rice or find the average sales of food products. Excel has special functions that can help you do this quickly.

We will learn four important functions:

  • SUMIF
  • SUMIFS
  • AVERAGEIF
  • AVERAGEIFS

Learning Objectives

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

  • Understand conditional calculation functions.
  • Use SUMIF to add values that meet one condition.
  • Use SUMIFS to add values that meet multiple conditions.
  • Use AVERAGEIF to calculate averages based on one condition.
  • Use AVERAGEIFS to calculate averages based on multiple conditions.
  • Apply these functions to real-life data analysis tasks.

1. Understanding Conditional Calculation Functions

A condition is a rule that tells Excel which information to use when performing a calculation.

For example, imagine a school has students from different classes. You may want to calculate the average score of only JSS 2 students instead of calculating the average score of everyone.

Instead of selecting the students manually, you can use a conditional function to let Excel do the work.

2. Using the SUMIF Function

The SUMIF function adds numbers that meet one condition.

Syntax:

=SUMIF(range, criteria, [sum_range])

Meaning:

  • Range: The cells Excel will check for a condition.
  • Criteria: The condition Excel must follow.
  • Sum_range: The numbers Excel should add.

Example: A supermarket in Ibadan records the following sales:

Product Category Sales (โ‚ฆ)
RiceFood50,000
SoapHousehold15,000
BeansFood30,000
MilkFood20,000
DetergentHousehold10,000

Suppose the categories are in column B and sales are in column C. To calculate the total sales of Food products, enter:

=SUMIF(B2:B6,"Food",C2:C6)

Answer: โ‚ฆ100,000

Excel adds the sales of rice, beans, and milk because they belong to the Food category.

3. Using the SUMIFS Function

SUMIFS is similar to SUMIF, but it allows you to use more than one condition.

For example, you may want to calculate the total sales of Food products made at the Ibadan branch only.

Syntax:

=SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)

Example:

Product Category Branch Sales (โ‚ฆ)
RiceFoodIbadan50,000
SoapHouseholdLagos15,000
BeansFoodIbadan30,000
MilkFoodLagos20,000
BreadFoodIbadan10,000

Assume the categories are in column B, branches are in column C, and sales are in column D.

To calculate sales for Food products at the Ibadan branch, enter:

=SUMIFS(D2:D6,B2:B6,"Food",C2:C6,"Ibadan")

Answer: โ‚ฆ90,000

Excel adds only the sales records that meet both conditions:

  • The category must be Food.
  • The branch must be Ibadan.

Important: In SUMIFS, all the conditions must be satisfied before Excel includes a value in the calculation.

4. Using the AVERAGEIF Function

AVERAGEIF calculates the average of numbers that meet one condition.

For example, a teacher may want to calculate the average examination score of students in JSS 2 only.

Syntax:

=AVERAGEIF(range, criteria, [average_range])

Example:

Student Class Score
AdeJSS 170
ChikaJSS 280
TundeJSS 260
FatimaJSS 190
EmekaJSS 2100

Assume the class names are in column B and the scores are in column C.

To calculate the average score of JSS 2 students, enter:

=AVERAGEIF(B2:B6,"JSS 2",C2:C6)

Answer: 80

Excel calculates the average of 80, 60, and 100. It ignores students in JSS 1.

5. Using the AVERAGEIFS Function

AVERAGEIFS calculates the average of numbers that meet two or more conditions.

For example, a school may want to calculate the average score of JSS 2 students who scored at least 50 marks.

Syntax:

=AVERAGEIFS(average_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)

Example:

Student Class Score
AdeJSS 170
ChikaJSS 280
TundeJSS 240
FatimaJSS 190
EmekaJSS 2100

Assume the class names are in column B and scores are in column C.

To calculate the average score of JSS 2 students who scored at least 50, enter:

=AVERAGEIFS(C2:C6,B2:B6,"JSS 2",C2:C6,">=50")

Answer: 90

Excel uses only Chika's score of 80 and Emeka's score of 100. Tunde's score is ignored because it is below 50.

6. Understanding Comparison Criteria

Excel allows you to use comparison operators as conditions in your calculations.

Operator Meaning Example
>Greater than>50
<Less than<40
>=Greater than or equal to>=50
<=Less than or equal to<=60
=Equal to=100
<>Not equal to<>0

When using comparison operators as criteria in these functions, put the condition inside quotation marks.

For example:

=SUMIF(C2:C10,">=5000")

This adds all the numbers in the range C2:C10 that are greater than or equal to 5,000.

7. Difference Between the Four Functions

Function What It Does
SUMIF Adds numbers that meet one condition.
SUMIFS Adds numbers that meet multiple conditions.
AVERAGEIF Calculates an average based on one condition.
AVERAGEIFS Calculates an average based on multiple conditions.

Remember: SUMIF and AVERAGEIF use one condition, while SUMIFS and AVERAGEIFS can use multiple conditions.

Also remember that SUMIFS starts with the sum range, while SUMIF starts with the condition range. AVERAGEIFS starts with the average range, while AVERAGEIF starts with the condition range.

8. Common Mistakes to Avoid

  • Incorrect ranges: Make sure the ranges contain the correct information.
  • Different range sizes: In SUMIFS and AVERAGEIFS, the criteria ranges should match the size of the sum or average range.
  • Wrong criteria: Check spelling and spacing in text conditions such as "Food" or "JSS 2".
  • Missing quotation marks: Text criteria and comparison expressions should be written correctly, such as "Food" or ">=50".
  • Wrong argument order: Remember that SUMIFS and AVERAGEIFS begin with the range to calculate.

9. Practical Exercise

Imagine you are helping a supermarket owner analyse sales records.

Product Category Branch Sales (โ‚ฆ)
RiceFoodIbadan40,000
SoapHouseholdLagos15,000
BeansFoodIbadan25,000
MilkFoodLagos20,000
DetergentHouseholdIbadan10,000
BreadFoodIbadan5,000

Complete the following tasks using Excel:

  1. Use SUMIF to calculate total sales for Food products.
  2. Use SUMIF to calculate total sales for Household products.
  3. Use SUMIFS to calculate total Food sales at the Ibadan branch.
  4. Use AVERAGEIF to calculate the average sales of Food products.
  5. Use AVERAGEIFS to calculate the average sales of Food products at the Ibadan branch.

10. Module Summary

In this module, we learned how to use four important Excel functions for data analysis:

  • SUMIF adds numbers based on one condition.
  • SUMIFS adds numbers based on multiple conditions.
  • AVERAGEIF calculates averages based on one condition.
  • AVERAGEIFS calculates averages based on multiple conditions.

These functions are useful when analysing school results, supermarket sales, business records, employee information, and many other datasets.

What Is Next?

In the next module, we will learn how to combine Excel functions to solve more complex data analysis problems. You will discover how to use multiple functions together to clean, calculate, organise, and analyse information more efficiently.

Keep practising! The more you use Excel functions, the easier data analysis becomes.

๐Ÿ† 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.
โ†’