COUNT and COUNTIF in Excel: Count Cells with Conditions

COUNTIF is an Excel function that counts cells in a range that meet a single condition you specify. To use it, type =COUNTIF(range, criteria) in any empty cell, replace range with the cells you want to check, and replace criteria with your condition, such as a number, text string or comparison like “>50”. It works in Excel 2010, 2016, 2019, Microsoft 365 and Google Sheets. Learning how to use count if formula in excel takes about ten minutes and saves hours of manual counting every week.

  • COUNT counts only numeric cells; COUNTA counts any non-empty cell, including text.
  • COUNTIF adds one condition; COUNTIFS lets you stack multiple conditions across different columns.
  • Wrap text criteria and comparison operators in double quotes: “Passed”, “>100”, “<="&A2.
  • Use wildcards * and ? inside COUNTIF to match partial text strings.
  • COUNTIF is one of the most tested functions in data analyst interview questions, so practise it with real datasets.

COUNT, COUNTA and COUNTBLANK

Before you master how to use count if formula in excel, you need to know which plain COUNT function to reach for first. Excel gives you three counting functions that need no conditions at all, and mixing them up is the most common beginner mistake on the job.

What Each Function Does

Function Counts Ignores Example
COUNT Numeric cells only Text, blanks, errors =COUNT(B2:B100)
COUNTA Any non-empty cell Blank cells only =COUNTA(A2:A100)
COUNTBLANK Empty cells All filled cells =COUNTBLANK(C2:C100)

Say you run MIS for a Delhi-based logistics company and your sheet has 200 rows of delivery records. Column B holds delivery amounts, but some rows say “Pending” instead of a number. =COUNT(B2:B201) gives you only the rows with actual figures. =COUNTA(B2:B201) gives you every filled row, including “Pending”. That difference matters when you are building a monthly report for your manager.

The Difference Between COUNT and COUNTA

COUNT is for numeric data only. COUNTA is for any data, including names, status labels and dates stored as text. If your count function in excel is returning a smaller number than you expect, the column probably has text mixed in with numbers, and COUNTA is what you actually need.

COUNTBLANK is underused but very practical. Use it to flag incomplete records before you submit a dataset. =COUNTBLANK(D2:D500) instantly tells you how many rows are missing a value in column D, which is exactly the kind of data-quality check that real data analytics projects require before any analysis begins.

How to Use Count If Formula in Excel for Text and Numbers

COUNTIF is the workhorse of conditional counting. Its syntax is =COUNTIF(range, criteria). The range is the column or block of cells you are checking. The criteria is the condition, and it must be in double quotes if it contains text or an operator. Understanding how to use count if formula in excel correctly means getting this syntax right every time.

Counting Numbers with Conditions

Suppose column C holds exam scores for 150 students at a Mumbai coaching institute. To count how many scored above 60, write =COUNTIF(C2:C151, “>60”). To count exactly 100, write =COUNTIF(C2:C151, 100). No quotes needed when the criteria is a plain number with no operator.

You can also reference a cell instead of typing the value directly. =COUNTIF(C2:C151, “>”&D1) reads the threshold from cell D1, which makes the formula dynamic. Change D1 from 60 to 75 and the count updates instantly. This is the kind of trick that separates a polished Excel report from a static one, and it is central to how to use count if formula in excel in a professional setting.

Counting Cells with Text

To apply how to use count if formula in excel for text, wrap the string in quotes: =COUNTIF(A2:A100, “Mumbai”) counts every cell that says exactly “Mumbai”. COUNTIF is not case-sensitive, so “mumbai” and “MUMBAI” both match.

Wildcards make text matching much more powerful. The asterisk * matches any sequence of characters. =COUNTIF(A2:A100, “Mum*”) counts “Mumbai”, “Mumtaz” and anything else starting with “Mum”. The question mark ? matches exactly one character. =COUNTIF(A2:A100, “B??”) matches any three-letter word starting with B, like “BSc” or “BBA”.

To count all non-empty text cells, use =COUNTIF(A2:A100, “*”). To count cells that contain a specific word anywhere in the string, use =COUNTIF(A2:A100, “*analyst*”). This is exactly what you would use to filter a job-title column for everyone with “analyst” in their role, a common task if you are studying to data analyst kaise bane and building portfolio projects.

A Practical Text Example

You have a sheet with 500 job applications. Column B holds the applicant’s city. You want to know how many are from Bangalore. Type =COUNTIF(B2:B501, “Bangalore”). Done. No filtering, no pivot table, no manual scroll. According to Microsoft’s official COUNTIF support documentation, COUNTIF supports up to 255 characters in the criteria string, so even long text conditions work cleanly.

COUNTIFS for Date Ranges and Multiple Conditions

COUNTIFS extends COUNTIF to multiple conditions. Its syntax is =COUNTIFS(range1, criteria1, range2, criteria2, …). Every range-criteria pair is evaluated together, and a row is counted only when it meets all conditions at once. This is how to use count if formula in excel when one condition is not enough.

Counting by Date Range

COUNTIF date range queries are one of the most searched Excel topics in India, especially among MIS executives and operations teams. Say column D holds order dates and you want to count orders placed in January 2025. The formula is:

=COUNTIFS(D2:D500, “>=01-01-2025”, D2:D500, “<=31-01-2025")

Both conditions apply to the same column, which is perfectly valid. For a dynamic version that reads start and end dates from cells F1 and F2, write:

=COUNTIFS(D2:D500, “>=”&F1, D2:D500, “<="&F2)

The & operator joins the comparison sign with the cell reference. A very common mistake is writing “>=F1” with the cell reference inside the quotes, which makes Excel treat F1 as literal text and the formula returns zero. Knowing how to use count if formula in excel with dynamic cell references is what makes your reports truly reusable.

Counting with Multiple Conditions Across Columns

You want to count orders from Hyderabad (column A) that are above Rs 10,000 (column C) and placed in Q1 2025 (column D). Stack all three:

=COUNTIFS(A2:A500, “Hyderabad”, C2:C500, “>10000”, D2:D500, “>=01-01-2025”, D2:D500, “<=31-03-2025")

This is how to count in excel with condition across multiple columns in one shot. No helper columns, no filtering. COUNTIFS handles up to 127 range-criteria pairs, though in practice you will rarely need more than four or five.

Why This Matters for Data Careers

According to LinkedIn’s Jobs on the Rise 2024 report, data analyst roles in India grew by over 40% year-on-year, with Excel listed as a core required skill in the majority of job postings. NASSCOM’s 2023 analytics workforce report noted that India has over 400,000 active data and analytics professionals, and Excel fluency remains a baseline expectation even as Python tools like Pandas and NumPy become standard in senior roles. According to Statista’s 2023 global software survey, Microsoft Excel is used by over 750 million people worldwide, making it the most widely deployed spreadsheet tool across enterprise and SMB segments. Knowing how to use count if formula in excel well puts you ahead in entry-level screening. If you are mapping out your career path, the data analyst vs data scientist comparison is worth reading next.

Common COUNTIF Mistakes and How to Fix Them

Most COUNTIF errors come from a handful of predictable habits. Knowing them upfront saves a lot of frustration when you are learning how to use count if formula in excel on real data.

Mistake 1: Forgetting Quotes Around Operators

Writing =COUNTIF(B2:B100, >50) without quotes returns an error. Any criteria with a comparison operator must be in quotes: “>50”, “<=100", “<>0″. A plain number like 50 does not need quotes, but the moment you add a sign, the quotes are mandatory.

Mistake 2: Mismatched Range Sizes in COUNTIFS

In COUNTIFS, every range must be the same size. If range1 is B2:B100 (99 rows) and range2 is C2:C101 (100 rows), Excel throws a #VALUE! error. Always double-check that your ranges have identical dimensions, especially when you copy-paste from another formula.

Mistake 3: Counting Cells That Look Like Numbers But Are Not

This happens a lot with data imported from ERPs or government portals like data.gov.in. The cells look numeric but are stored as text, so =COUNTIF(C2:C100, “>100”) returns zero even when values clearly exceed 100. Select a suspect cell and check the format in the Number group on the Home tab. If it shows “Text”, you need to convert the column before your formula will work correctly.

Mistake 4: Using COUNTIF When You Need COUNTIFS

COUNTIF only takes one criteria pair. If you try to squeeze two conditions into a single COUNTIF, it will not work the way you expect. Switch to COUNTIFS the moment you need two or more conditions. It is the same syntax, just extended, and it is the right tool for the job. Analysts who know how to use count if formula in excel and its multi-condition extension tend to score well in highest paying tech skills assessments where Excel is tested under time pressure.

One real on-the-job insight: always test your COUNTIF formula on a small, manually verifiable subset before applying it to thousands of rows. If your formula says 47 but you can manually count 50 in the first 20 rows, something is wrong with your criteria or your data types, and catching it early saves you from sending a wrong report to a client.

Frequently Asked Questions

How do I use COUNTIF in Excel?

Type =COUNTIF(range, criteria) in an empty cell. Replace range with the cells you want to check, such as A2:A100, and replace criteria with your condition, such as “Passed”, “>50” or a cell reference. Press Enter and Excel returns the count of cells that match. This is the core of how to use count if formula in excel and the starting point for all conditional counting tasks.

How do I count cells with text in Excel?

Use =COUNTIF(range, “your text”) for an exact match, or =COUNTIF(range, “*keyword*”) to count cells that contain the keyword anywhere in the string. COUNTIF is not case-sensitive, so “Mumbai” and “mumbai” both count the same way. For all non-blank text cells, use =COUNTIF(range, “*”). Knowing how to use count if formula in excel for text is essential for filtering name, city and status columns.

How do I use COUNTIF for a date range?

Use COUNTIFS with two conditions on the same date column: =COUNTIFS(D2:D500, “>=start date”, D2:D500, “<=end date"). For a dynamic version, store your start and end dates in two cells and reference them with “>=”&F1 and “<="&F2. Never put the cell reference inside the quotes or the formula will return zero. This is one of the most practical applications of how to use count if formula in excel in MIS and operations roles.

What is the difference between COUNT and COUNTA?

COUNT only counts cells that contain numbers. COUNTA counts every non-empty cell, including text, dates and logical values like TRUE or FALSE. If your column has a mix of numbers and text labels, COUNT will give you a lower number than COUNTA. Use COUNT for numeric data and COUNTA when you want to know how many cells have any content at all.

How do I count with multiple conditions?

Use =COUNTIFS(range1, criteria1, range2, criteria2). Each range-criteria pair is a separate condition, and a row is only counted when it satisfies every condition simultaneously. All ranges must be the same size. You can add as many pairs as you need, making COUNTIFS the right answer any time you want to count in excel with condition across more than one column. This is the natural next step after you learn how to use count if formula in excel with a single condition.

You now have a complete toolkit for conditional counting in Excel, from basic COUNT through to multi-condition COUNTIFS across date ranges and text fields. These functions are used daily in MIS, operations, HR and finance teams across India and globally. Practise how to use count if formula in excel on a real dataset this week, even a simple attendance sheet or expense log, and the syntax will stick immediately.

  1. Download a free sample dataset from data.gov.in or Kaggle’s India datasets and write five COUNTIF formulas on it today.
  2. Try building a dynamic dashboard where COUNTIFS reads date inputs from cells, then watch the counts update as you change the dates.
  3. Read the data analytics projects guide to find a beginner project where you can apply these formulas in context, then add it to your portfolio.

Excel skills like COUNTIF and COUNTIFS translate directly into security analytics work. SOC analysts filter event logs, count alert types by severity and build condition-based dashboards every single day using the same conditional logic you just learned. If you want to take these data skills into a cybersecurity career, explore the EC-Council Certified SOC Analyst course at 3.0 University or browse the full catalogue of 3.0 University online certification courses in Cybersecurity, Ethical Hacking, AI, Blockchain and Web3.

Last updated: June 2025. Reviewed by the 3University editorial team.

We create, review, and maintain educational content covering Cybersecurity, Ethical Hacking, Artificial Intelligence, Blockchain, Web3, and emerging technologies.

Read More Articles