๐ Excel Basics #14 โ COUNTIF() & COUNTIFS() Functions
The "COUNTIF()" and "COUNTIFS()" functions count cells that meet one or more conditions. They are extremely useful for analyzing large datasets and creating reports.
๐ 1. COUNTIF() Function
The "COUNTIF()" function counts cells based on a single condition.
Syntax:
=COUNTIF(range, criteria)
Example:
A
Apple
Banana
Apple
Orange
Apple
Formula:
=COUNTIF(A2:A6,"Apple")
Result:
3
Excel counts how many times "Apple" appears.
๐ Example with Numbers
Sales
5000
12000
8000
15000
20000
Formula:
=COUNTIF(A2:A6,">10000")
Result:
3
This counts all sales greater than 10,000.
๐ 2. COUNTIFS() Function
The "COUNTIFS()" function counts cells based on multiple conditions.
Syntax:
=COUNTIFS(criteriaแตฃange1, criteria1, criteriaแตฃange2, criteria2,...)
Example:
Employee | Department | Sales
Rahul | IT | 60000
Priya | HR | 55000
Amit | IT | 45000
Neha | IT | 70000
Formula:
=COUNTIFS(B2:B5,"IT",C2:C5,">50000")
Result:
2
This counts employees who:
โข Belong to the IT department.
โข Have sales greater than 50,000.
๐ Common Criteria Examples
โข "Apple" โ Exact text
โข ">100" โ Greater than
โข "<50" โ Less than
โข ">=1000" โ Greater than or equal to
โข "<>0" โ Not equal to zero
๐ Real-World Uses
โข Count employees in a department.
โข Count products with sales above a target.
โข Count overdue invoices.
โข Count students who scored above a passing mark.
โข Count orders from a specific region.
๐ Common Mistakes
โข Selecting ranges of different sizes in "COUNTIFS()".
โข Forgetting to enclose text criteria in double quotes.
โข Using incorrect comparison operators.
โ
Best Practices
โข Use "COUNTIF()" for a single condition.
โข Use "COUNTIFS()" when multiple conditions are required.
โข Ensure all criteria ranges in "COUNTIFS()" are the same size.
โข Use cell references for criteria to make formulas dynamic.
Example:
=COUNTIF(B2:B100,E1)
If E1 contains "IT", Excel counts all IT records automatically.
Double Tap โค๏ธ For More
Post #2230
3.25K
- โค 13
- ๐ 1