// Excel Tutorial

SUMIF & COUNTIF

These functions are a lifesaver at times. Once you know how to use them, you'll wonder how you managed without them β€” especially with large datasets.

🎯
What you'll learn: How to count specific items in a large list with COUNTIF, and how to sum values that match a condition with SUMIF β€” two of the most-needed functions in business reporting.

COUNTIF β€” Count Specific Items

COUNTIF counts the number of times a specific item appears in a range β€” without manually scanning every row.

=COUNTIF(range, criteria)

β€” range : the column or cells to search through
β€” criteria : the value to look for (text in quotes, or a number)

Example β€” Count by Last Name

First NameLast NameBasic
RahulVerma5,000
RohanVerma5,500
MohitSharma5,000
MohanVerma5,600

Imagine this table had 2,000 rows. To count how many employees have the last name "Verma":

=COUNTIF(B2:B5, "Verma")

Result: 3  (Rahul, Rohan, and Mohan Verma)
πŸ’‘
Use wildcards for partial matches: =COUNTIF(B2:B5,"V*") counts all last names starting with "V". Use "*"&A1&"*" to count cells containing the value in cell A1.

SUMIF β€” Sum Based on a Condition

SUMIF is similar to COUNTIF but instead of counting, it sums values in one column where a matching condition is met in another column.

=SUMIF(range, criteria, sum_range)

β€” range : the column to check for the condition
β€” criteria : the matching value
β€” sum_range : the column whose values to add up

Example β€” Total Salary Where Basic = 5,000

First NameLast NameBasicTotal Salary
RahulVerma5,00025,000
RohanVerma5,50030,000
MohitSharma5,00026,000
MohanVerma5,60034,000
=SUMIF(C2:C5, 5000, D2:D5)

β€” C2:C5 : Basic column (what we're checking)
β€” 5000 : the criteria
β€” D2:D5 : Salary column (what we're adding up)

Result: 51,000  (Rahul 25,000 + Mohit 26,000)

COUNTIF vs SUMIF β€” Quick Reference

FunctionDoes WhatReturnsUse When You Need…
COUNTIFCounts cells matching criteriaA countHow many rows match a condition
SUMIFSums values where criteria matchA totalTotal amount for a specific category
πŸš€
Going further: Excel also has COUNTIFS and SUMIFS (plural) which support multiple conditions at once β€” e.g. sum salary where Department = "Sales" AND Region = "North". These are extremely powerful for dashboards and reports.
πŸ“₯
Download the example file to practice: countif.zip