Excel Practice Test

โ–ถ

How to Count Cells With Text in Excel

You'd think Excel would have a simple function called COUNTTEXT โ€” but it doesn't, and that's why this question comes up so often. People try =COUNT(A1:A100) on a column of names and get 0 back, which is confusing until you realise that COUNT specifically counts numbers, not text.

The function you actually need depends on exactly what you're trying to count: all non-empty cells (COUNTA), only text cells excluding numbers (COUNTIF with a wildcard), or cells containing a specific word (COUNTIF with that word). Each does something different, and picking the wrong one is the most common reason people get unexpected results from their counting formulas.

Counting cells that contain text in Excel is a surprisingly common need โ€” and there's no single COUNT function that does it directly, which trips up a lot of people. The standard COUNT function only counts cells containing numbers. If you use =COUNT(A1:A100) on a column of names, it returns 0 because names are text, not numbers. To count cells with text, you need either COUNTA (which counts all non-empty cells), COUNTIF with a wildcard (which counts specifically text-containing cells), or another approach depending on exactly what you're trying to measure.

The right formula depends on your specific situation. Do you want to count all non-empty cells regardless of content type? Use COUNTA. Do you want to count only cells containing text (excluding numbers, dates, and blanks)? Use COUNTIF with the wildcard '*'. Do you want to count cells containing a specific word or phrase? Use COUNTIF with that text as the criteria. Do you want to count cells with text that meet multiple conditions? Use COUNTIFS. Each method answers a slightly different question about your data.

Getting this wrong usually means using COUNT when you should use COUNTA, or using COUNTA when you actually need COUNTIF. COUNT counts numbers only. COUNTA counts everything that isn't blank. COUNTIF counts cells matching a specific criterion โ€” including text-specific criteria. Understanding which function matches your actual need prevents the frustration of formulas that return unexpected results. This guide covers all four methods with clear examples so you can pick the right approach for your data.

One context that makes text counting particularly useful: data quality checks. If a column should contain text entries (names, descriptions, status labels) for every row of data, counting the text cells and comparing that count to the expected number of rows instantly reveals missing entries. Similarly, counting cells with specific text values โ€” how many entries say 'Complete' versus 'Pending' โ€” provides quick status summaries without building pivot tables or complex reports.

  • Count all non-empty cells: =COUNTA(A1:A100) โ€” counts every cell that contains anything (text, numbers, dates, formulas, errors)
  • Count only text cells: =COUNTIF(A1:A100,"*") โ€” the asterisk wildcard matches any text; doesn't count numbers, blanks, or errors
  • Count cells with specific text: =COUNTIF(A1:A100,"Complete") โ€” counts cells containing exactly 'Complete'
  • Count cells containing a word: =COUNTIF(A1:A100,"*apple*") โ€” counts cells containing 'apple' anywhere in the text
  • Count text cells excluding blanks: =COUNTA(A1:A100)-COUNT(A1:A100) โ€” subtracts numeric cells from all non-empty cells, leaving text count
  • Count text with multiple conditions: =COUNTIFS(A1:A100,"*",B1:B100,">100") โ€” counts rows where column A has text AND column B exceeds 100

Method 1: COUNTA โ€” Count All Non-Empty Cells

book

COUNTA counts the number of cells in a range that are not empty โ€” regardless of what they contain. Text, numbers, dates, formulas that return values, logical values (TRUE/FALSE), and error values (#N/A, #VALUE!) are all counted. Only completely empty cells are excluded. COUNTA is the simplest 'counting' function and works when you just need to know how many cells have something in them.

rows

=COUNTA(A2:A100) counts every non-empty cell in the range A2 through A100. If you have 50 names, 10 numbers, and 40 blank cells in that range, COUNTA returns 60 (the 50 text cells plus the 10 number cells). COUNTA doesn't distinguish between text and numbers โ€” it counts everything that isn't blank. This is its strength for general 'how many entries do I have' questions and its limitation when you specifically need text-only counts.

star

Use COUNTA when you want to count all filled cells in a column regardless of content type โ€” for example, counting how many rows of data exist in a dataset, counting how many responses were received in a survey column, or checking whether every required field has been filled in. COUNTA is also useful as the denominator in percentage calculations: =COUNTIF(A2:A100,'Complete')/COUNTA(A2:A100) gives the percentage of entries marked as Complete out of all entries.

check

COUNTA counts cells containing formulas that return empty strings ('') or spaces. A cell that appears blank but contains =IF(B2='','','') is counted by COUNTA because the cell contains a formula, even though it displays nothing. If your COUNTA count seems too high, check for cells with formulas returning empty strings or cells containing only spaces. Use =SUMPRODUCT((LEN(TRIM(A2:A100))>0)*1) for a more precise count that ignores cells with only spaces or empty strings.

Method 2: COUNTIF With Wildcards โ€” Count Only Text Cells

When you need to count specifically text-containing cells โ€” excluding numbers, dates, and blanks โ€” COUNTIF with the asterisk (*) wildcard is the cleanest approach. The formula =COUNTIF(A2:A100,'*') counts only cells containing text strings. The asterisk matches any sequence of characters, so any cell with text matches the criterion. Numbers, dates, blank cells, and error values don't match the text wildcard.

This distinction matters when your column contains a mix of data types. A column that has names in some rows and ages in others would return different results for COUNTA (counts both names and ages) versus COUNTIF with '*' (counts only the name entries). If you're specifically asking 'how many text entries are in this column?' โ€” not 'how many non-empty cells?' โ€” the COUNTIF wildcard method gives you the precise answer.

The COUNTIF wildcard approach also handles a scenario that confuses many users: counting cells that contain any text at all in a mixed column. If column A has customer names in rows 2โ€“30, order numbers (numeric) in rows 31โ€“60, and blank cells in rows 61โ€“100, =COUNTIF(A2:A100,'*') returns 29 โ€” counting only the text name entries while ignoring both the numbers and blanks. No other single function provides this specific filtering behaviour with such simple syntax.

For counting cells that contain specific text, replace the wildcard with your search term. =COUNTIF(A2:A100,'Complete') counts cells containing exactly 'Complete' โ€” the match is case-insensitive, so 'complete,' 'COMPLETE,' and 'Complete' all match. To count cells containing a word anywhere in the text (partial match), use wildcards around the word: =COUNTIF(A2:A100,'*apple*') counts any cell where 'apple' appears somewhere in the text โ€” 'apple pie,' 'green apple,' and 'pineapple' would all match.

COUNTIF with text criteria handles most text-counting scenarios that COUNTA can't โ€” and it's the formula you'll use most often when the question is specifically about text rather than just non-empty cells. The key is matching your criteria to your question: exact match (no wildcards), contains match (wildcards on both sides), starts with ('apple*'), or ends with ('*apple').

One important nuance: COUNTIF counts cells where the entire cell content matches the criteria. =COUNTIF(A2:A100,'Apple') matches a cell containing only 'Apple' but NOT a cell containing 'Apple Pie' (because the entire content isn't 'Apple'). For partial matching โ€” counting cells that contain the word 'Apple' anywhere โ€” you need the wildcards: =COUNTIF(A2:A100,'*Apple*'). This is a common source of confusion when COUNTIF returns fewer matches than expected.

More Methods for Counting Text Cells

๐Ÿ”ด Method 3: COUNTA Minus COUNT

=COUNTA(A2:A100)-COUNT(A2:A100) gives you the number of text cells by subtracting the count of numeric cells from the count of all non-empty cells. COUNTA counts everything that isn't blank; COUNT counts only numbers. The difference is the number of cells containing text, logical values, or errors. This method works well when you need a quick text count and your data doesn't contain errors or logical values (which would also be included in the difference).

๐ŸŸ  Method 4: SUMPRODUCT With ISTEXT

=SUMPRODUCT(ISTEXT(A2:A100)*1) counts cells that Excel recognises as text type โ€” the most precise text-counting method. ISTEXT returns TRUE for text cells and FALSE for everything else (numbers, blanks, errors, logical values). Multiplying by 1 converts TRUE/FALSE to 1/0, and SUMPRODUCT sums them. Unlike COUNTIF with '*', this method correctly handles cells containing numbers stored as text (which ISTEXT recognises as text) and excludes error values.

๐ŸŸก COUNTIFS: Text Count With Multiple Conditions

=COUNTIFS(A2:A100,'*',B2:B100,'Active') counts rows where column A contains text AND column B equals 'Active'. COUNTIFS allows multiple criteria across different columns. Each criterion pair (range, criteria) must be met in the same row for the cell to be counted. You can combine text wildcards with numeric conditions: =COUNTIFS(A2:A100,'*Sales*',C2:C100,'>50000') counts rows containing 'Sales' in column A where column C exceeds 50,000.

๐ŸŸข Counting Specific Text Values (Multiple)

To count cells matching any of several text values โ€” for example, counting cells that contain 'Yes,' 'Approved,' or 'Complete' โ€” use SUMPRODUCT with OR logic: =SUMPRODUCT((A2:A100='Yes')+(A2:A100='Approved')+(A2:A100='Complete')>0)*1). Alternatively, use multiple COUNTIF formulas added together: =COUNTIF(A2:A100,'Yes')+COUNTIF(A2:A100,'Approved')+COUNTIF(A2:A100,'Complete'). The COUNTIF addition approach is simpler to read and easier for other spreadsheet users to understand when they encounter your formula. When deciding between approaches for multi-value text counting, choose the one that makes the formula's intent clearest to whoever will maintain the workbook after you โ€” readability often matters more than formula elegance in collaborative environments.

COUNT vs COUNTA vs COUNTIF: Understanding the Differences

๐Ÿ“‹ What Each Function Counts

The three main counting functions serve different purposes:

  • COUNT: Counts cells containing numbers ONLY. Ignores text, blanks, errors, and logical values. =COUNT(A1:A10) on a list of names returns 0
  • COUNTA: Counts ALL non-empty cells โ€” text, numbers, dates, formulas, errors, logical values. Only truly empty cells are excluded. The most inclusive counting function
  • COUNTIF: Counts cells matching a specific criterion. The criterion can be text ('Apple'), a number ('>100'), or a wildcard ('*' for any text). The most flexible counting function โ€” it can replicate COUNT and COUNTA behaviour while also handling specific matching
  • COUNTBLANK: Counts empty cells โ€” the opposite of COUNTA. Useful for finding how many entries are missing from a column

๐Ÿ“‹ Common Mistakes and Fixes

The most common text-counting errors and how to solve them:

  • Using COUNT instead of COUNTA: COUNT returns 0 for text columns because it only counts numbers. Switch to COUNTA for all non-empty cells or COUNTIF with '*' for text specifically
  • COUNTA counting 'empty' cells: Cells containing formulas that return '' (empty string) are counted by COUNTA because they contain a formula. Use =SUMPRODUCT((A2:A100<>'')*1) or COUNTIF with '*' to exclude these
  • COUNTIF not matching text: Check whether you need partial matching ('*word*') versus exact matching ('word'). Also verify that the cells aren't numbers formatted to look like text
  • Extra spaces causing mismatches: 'Apple' and 'Apple ' (trailing space) don't match exactly. Use TRIM to clean data: =COUNTIF(A2:A100,TRIM(B1)) where B1 contains the search term

Practical Examples of Counting Text in Excel

Real-world scenarios make text-counting formulas more concrete than abstract syntax descriptions. Here are several situations where counting text cells is the most efficient solution to a practical problem.

Survey response counting: you have a column where respondents typed 'Yes,' 'No,' or left the cell blank. =COUNTIF(B2:B200,'Yes') counts how many said Yes. =COUNTIF(B2:B200,'No') counts how many said No. =COUNTBLANK(B2:B200) counts how many didn't answer. Together, these three formulas give you a complete response breakdown without building a pivot table or chart. For percentage calculations, divide each count by COUNTA(B2:B200) to get the percentage of respondents who answered.

Status tracking: a project tracker has a Status column with entries like 'Not Started,' 'In Progress,' 'Complete,' and 'Blocked.' =COUNTIF(D2:D50,'Complete') tells you how many tasks are done. =COUNTIF(D2:D50,'Blocked') flags how many need attention. =COUNTIF(D2:D50,'In Progress') shows how many are active.

These counts form the basis of a dashboard without any complex formulas or macros โ€” simple COUNTIF against a status column provides immediate project health metrics. You can even build a progress bar by using =COUNTIF(D2:D50,'Complete')/COUNTA(D2:D50) formatted as a percentage inside a cell with a data bar conditional formatting rule โ€” giving a visual progress indicator driven entirely by the Status column's text entries.

Data quality checks: a customer database should have entries in every required field. =COUNTA(C2:C1000) compared to the expected row count reveals missing entries. =COUNTIF(C2:C1000,'*@*') counts cells containing an @ sign โ€” a quick check for email address presence. =COUNTIF(E2:E1000,'*') compared to the total row count shows how many rows have text in column E versus how many are blank. These simple counts catch data quality issues that visual scanning would miss in large datasets.

Employee scheduling and attendance: a shift schedule has names in cells for assigned shifts and blank cells for unassigned shifts. =COUNTA(B2:B32) counts how many shifts are staffed across a month. =COUNTBLANK(B2:B32) counts unstaffed shifts. =COUNTIF(B2:B32,'John') counts how many shifts a specific employee is assigned. These counts produce scheduling summaries that update automatically as the schedule changes โ€” no separate report needed.

Inventory categorisation: a product list has a Category column. =COUNTIF(F2:F500,'Electronics') counts electronics products. =COUNTIF(F2:F500,'*Furniture*') counts anything categorised as furniture (including subcategories like 'Office Furniture' or 'Outdoor Furniture'). Using these counts across all categories tells you how your inventory is distributed without sorting the data or building a separate summary.

Text Counting Best Practices

Use COUNTA when you want to count all non-empty cells regardless of content type โ€” it's the simplest and broadest counting function
Use COUNTIF with '*' when you specifically need to count text cells and exclude numbers, dates, and blanks
Use COUNTIF with specific text criteria for exact matching ('Complete') or partial matching ('*keyword*') โ€” remember it's case-insensitive
Use SUMPRODUCT with ISTEXT for the most precise text-type detection โ€” it correctly identifies text versus numbers stored as text
Check for hidden spaces in your data โ€” TRIM your search criteria or data before counting to avoid mismatches caused by leading or trailing spaces
Verify your formula with a small sample first โ€” count a range of 10 cells where you can manually verify the answer before applying to thousands of rows
For counting text in filtered data, use SUBTOTAL(3,range) instead of COUNTA โ€” SUBTOTAL ignores hidden rows while COUNTA counts them

COUNTA vs COUNTIF for Text Counting

Pros

  • COUNTA is simpler โ€” one argument, no criteria to specify. If you just need 'how many cells have something in them,' COUNTA is the fastest formula to write
  • COUNTIF with '*' is more precise for text โ€” it excludes numbers and dates, giving you a true text-only count that COUNTA can't provide
  • COUNTA handles mixed content gracefully โ€” it counts everything non-empty, making it ideal when your data contains both text and numbers and you want to count all entries
  • COUNTIF supports partial matching โ€” wildcards let you count cells containing a specific word or pattern, which COUNTA can't do at all

Cons

  • COUNTA counts formula-generated empty strings ('') โ€” cells that look blank but contain formulas are counted, potentially inflating your count
  • COUNTIF with '*' doesn't count numbers stored as text โ€” if your data has numeric values entered as text (common in imported data), COUNTIF '*' counts them as text while you might want them excluded
  • COUNTA can't distinguish between text and numbers โ€” if you need text-only counts in a mixed column, COUNTA alone isn't sufficient
  • COUNTIF requires exact criteria specification โ€” misspelling the search text, forgetting wildcards, or not accounting for case sensitivity in certain contexts can produce incorrect counts

Advanced Text Counting Techniques

Beyond basic counting, several advanced techniques handle more complex text-counting scenarios that simple COUNTIF can't address.

Counting unique text values โ€” how many distinct text entries exist in a range โ€” requires an array approach. =SUMPRODUCT(1/COUNTIF(A2:A100,A2:A100)) counts unique values (but fails if any cell is blank). For a blank-safe version: =SUMPRODUCT((A2:A100<>'')/COUNTIF(A2:A100&'',A2:A100&'')) handles empty cells correctly. In Excel 365, the simpler =COUNTA(UNIQUE(FILTER(A2:A100,A2:A100<>''))) uses dynamic array functions to count unique non-blank entries.

Counting text cells by length is useful for data validation. =SUMPRODUCT((LEN(A2:A100)>50)*ISTEXT(A2:A100)*1) counts text cells with more than 50 characters โ€” useful for identifying entries that exceed a field length limit. =SUMPRODUCT((LEN(A2:A100)=0)*(A2:A100<>'')*1) counts cells that contain formulas returning empty strings (look empty but aren't) โ€” a diagnostic tool for finding phantom entries that inflate COUNTA counts.

Case-sensitive text counting requires EXACT inside SUMPRODUCT. =SUMPRODUCT(EXACT(A2:A100,'Apple')*1) counts cells containing exactly 'Apple' with matching case โ€” distinguishing between 'Apple,' 'apple,' and 'APPLE.' Standard COUNTIF is case-insensitive, so this array approach is necessary when case matters (product codes, abbreviations, proper nouns where case carries meaning).

Counting text cells that start or end with specific characters is handled by positioning the wildcard. =COUNTIF(A2:A100,'Dr.*') counts cells starting with 'Dr.' โ€” useful for identifying doctor titles in a name list. =COUNTIF(A2:A100,'*.pdf') counts cells ending with '.pdf' โ€” useful for identifying file type references. The wildcard positioning determines the matching logic: start only, end only, contains anywhere, or exact match (no wildcards).

Counting text cells across multiple sheets can be done with 3D references for COUNTA: =COUNTA(Sheet1:Sheet12!A2:A100) counts non-empty cells in the same range across sheets 1 through 12. COUNTIF doesn't support 3D references directly, so for multi-sheet text-specific counting, you'd need to add individual COUNTIF formulas for each sheet: =COUNTIF(Sheet1!A2:A100,'*')+COUNTIF(Sheet2!A2:A100,'*')+... or use SUMPRODUCT with INDIRECT for a more dynamic approach.

Excel Practice Test โ€” Formulas and Functions

Text Counting Functions: Quick Reference

COUNTA
Counts all non-empty cells โ€” text, numbers, dates, errors, logical values. The broadest counting function. Only truly blank cells are excluded
COUNTIF(*)
=COUNTIF(range,"*") counts only text cells โ€” the asterisk wildcard matches any text string. Doesn't count numbers, blanks, or errors
COUNT
Counts only numeric cells โ€” returns 0 for a column of text. This is the function people mistakenly use when they want COUNTA
COUNTBLANK
Counts empty cells โ€” the opposite of COUNTA. Useful for finding how many entries are missing from a required field
ISTEXT
Returns TRUE if a cell contains text โ€” use inside SUMPRODUCT for the most precise text-type counting: =SUMPRODUCT(ISTEXT(range)*1)
COUNTIFS
Counts text cells matching multiple conditions across different columns โ€” each criterion pair must be met in the same row for the cell to be counted

Counting Text in Excel Tables and Filtered Data

When your data is in an Excel Table (Ctrl+T) or has filters applied, standard text-counting formulas may not behave as expected โ€” and knowing the alternatives prevents incorrect results in filtered views.

COUNTA and COUNTIF count ALL cells in the specified range, including hidden rows. If you've applied a filter to show only 'Active' records but your COUNTIF formula counts all records (including hidden 'Inactive' ones), the count doesn't match what you see on screen. For filtered data, use SUBTOTAL instead: =SUBTOTAL(3,A2:A100) works like COUNTA but ignores hidden rows. There's no SUBTOTAL equivalent of COUNTIF, so for filtered text-specific counting, you'd need an array formula: =SUMPRODUCT(SUBTOTAL(3,OFFSET(A2,ROW(A2:A100)-ROW(A2),0))*(A2:A100='Complete')).

In Excel Tables, structured references make formulas self-documenting. Instead of =COUNTIF(A2:A100,'Complete'), use =COUNTIF(Table1[Status],'Complete'). The structured reference [Status] automatically adjusts as the table grows โ€” new rows are included without modifying the formula. This is one of the strongest arguments for converting data to Tables before applying counting formulas: the formulas never go stale when data is added.

Dashboard formulas that reference filtered tables should be built with awareness of whether the count should reflect the filtered view or the full dataset. Summary cells at the top of a dashboard typically show full-dataset counts (COUNTIF on the full table column), while in-context counts within the filtered area should use SUBTOTAL-based approaches. Mixing these two approaches โ€” full-count in one cell and filtered-count in another โ€” creates confusing dashboards where numbers don't appear to add up. Be explicit about which approach each formula uses.

Another consideration for Table-based counting: when you delete rows from a Table, the structured reference automatically shrinks to exclude the deleted rows. This means your counts adjust without any formula modification โ€” unlike range-based formulas where deleting rows might leave the formula referencing rows that no longer contain data (producing a count that's too low if the range shrinks) or that now contain different data (producing a count that's too high if data was rearranged). This self-adjusting behaviour is one of the strongest arguments for using Tables in any dataset where rows are regularly added or removed.

Combining Text Counts With Other Formulas

Text counts become more powerful when combined with other Excel formulas to create calculated metrics, conditional alerts, and automated summaries.

Percentage calculations using text counts are straightforward: =COUNTIF(B2:B100,'Yes')/COUNTA(B2:B100) gives the percentage of 'Yes' responses out of all responses. Format as Percentage to display as a percentage rather than a decimal. For multi-option surveys, this pattern โ€” COUNTIF for each option divided by the total COUNTA โ€” gives you a complete percentage breakdown that updates automatically as new responses are added.

Conditional formatting driven by text counts highlights cells based on how many matching entries exist. If you want to highlight any status value that appears fewer than 3 times in the Status column (rare statuses that might be data entry errors), set a conditional formatting rule with the formula =COUNTIF($D:$D,D2)<3 on the Status column. Cells with rare values light up for review.

IF statements using text counts create automated status indicators. =IF(COUNTIF(E2:E50,'Blocked')>0,'Action Required','All Clear') checks whether any task is blocked and displays a warning message. =IF(COUNTIF(C2:C100,'*')<ROW(C100)-1,'Missing Entries','Complete') checks whether every row has text in column C and flags if any are missing. These formula-driven alerts eliminate the need to manually scan columns for specific conditions.</p>

Data validation summaries that use text counts are particularly useful in workbooks that multiple people edit. If you have a data entry sheet where different team members enter information, a summary row at the top showing =COUNTA(B2:B500)&' of '&(ROW(B500)-1)&' rows filled' gives an instant progress indicator โ€” '237 of 499 rows filled' โ€” that everyone can see. Adding =COUNTIF(B2:B500,'*ERROR*') as an error counter flags rows that someone has marked for review, creating a self-documenting worksheet that communicates its own status without anyone needing to send update emails or check in manually on data entry progress.

This kind of formula-driven communication is one of the most underappreciated productivity gains in shared Excel workbooks โ€” the spreadsheet itself becomes the status report, updated in real time as new entries are made by any team member who has the file open. It turns passive data storage into active communication โ€” which is what well-designed spreadsheets should do.

Excel Questions โ€” Formulas and Spreadsheet Skills

Excel Count Cells With Text Questions and Answers

How do I count cells with text in Excel?

Use =COUNTIF(A1:A100,"*") to count cells containing text specifically. The asterisk (*) wildcard matches any text string, so this formula counts all text cells while excluding numbers, blanks, and errors. If you want to count ALL non-empty cells (including numbers), use =COUNTA(A1:A100) instead. For counting cells with specific text, use =COUNTIF(A1:A100,"Complete") for exact matches or =COUNTIF(A1:A100,"*keyword*") for partial matches.

What is the difference between COUNT and COUNTA?

COUNT counts only cells containing numbers โ€” it returns 0 for a column of text. COUNTA counts ALL non-empty cells regardless of content type โ€” text, numbers, dates, formulas, errors. If you're trying to count text entries and getting 0, you're probably using COUNT when you should use COUNTA. COUNTA is the function most people actually need when they think they need COUNT.

How do I count cells containing a specific word?

For exact match: =COUNTIF(A1:A100,"Apple") counts cells containing exactly 'Apple' (case-insensitive). For partial match (word appears anywhere in the cell): =COUNTIF(A1:A100,"*Apple*") counts cells where 'Apple' appears anywhere in the text โ€” including 'Apple Pie' and 'Green Apple.' The asterisks (*) are wildcards representing any characters before and after the search term.

Why does COUNTA count cells that look empty?

COUNTA counts cells containing formulas that return empty strings (''). A cell with =IF(B2='','','') looks empty but contains a formula โ€” COUNTA counts it. To avoid this, use =COUNTIF(A1:A100,"*") (which doesn't count empty strings) or =SUMPRODUCT((LEN(TRIM(A1:A100))>0)*1) (which only counts cells with visible content). This is the most common reason COUNTA returns a higher count than expected.

How do I count text cells in filtered data?

Standard COUNTA and COUNTIF count all cells including hidden rows. For filtered data, use SUBTOTAL: =SUBTOTAL(3,A2:A100) works like COUNTA but ignores hidden (filtered-out) rows. There's no direct SUBTOTAL equivalent of COUNTIF, so for counting specific text in filtered data, use an array formula with SUBTOTAL or switch to a pivot table, which naturally respects filter selections.

Is COUNTIF case-sensitive for text?

No โ€” standard COUNTIF is case-insensitive. =COUNTIF(A1:A100,"apple") matches 'Apple,' 'APPLE,' and 'apple' equally. For case-sensitive counting, use SUMPRODUCT with EXACT: =SUMPRODUCT(EXACT(A1:A100,"Apple")*1) counts only cells containing 'Apple' with that exact capitalisation. Case-sensitive counting is needed when values like product codes or abbreviations have meaning tied to their case.
โ–ถ Start Quiz