No, the standard COUNTIF function in Google Sheets is not case sensitive – it treats “Apple”, “apple”, and “APPLE” as the same value. To count cells with case‑sensitive matching, you must use COUNTIF combined with ARRAYFORMULA and EXACT, or switch to FILTER plus EXACT.
Why COUNTIF Ignores Case by Default
Google Sheets’ COUNTIF is designed for quick, flexible counting of values that match a condition. Internally, it compares text using a case‑insensitive rule, similar to how the = operator works in a formula like =A1="apple". This is convenient for most tasks – for example, counting all orders marked “paid” regardless of whether someone typed “Paid”, “PAID”, or “paid”.
This behavior is consistent with Excel’s COUNTIF, which also ignores case. However, the workaround differs: Excel has a separate COUNTIFS function that still ignores case, but you can use SUMPRODUCT with EXACT there. In Google Sheets, the cleanest approach uses ARRAYFORMULA because EXACT normally works on a single pair of values.
How to Count Case‑Sensitive Matches with EXACT
The EXACT function compares two text strings and returns TRUE only if they are identical, including letter case. To use it across a range, you need to make the comparison evaluate each cell individually.
Assume your data is in A2:A10 and you want to count how many cells contain exactly “Apple” (with a capital A, lowercase rest). Enter this formula:
=ARRAYFORMULA(SUM(--EXACT(A2:A10, "Apple")))
How it works:
EXACT(A2:A10, "Apple")returns an array ofTRUE/FALSEvalues.- The double unary
--convertsTRUEto 1 andFALSEto 0. SUMadds those 1s, giving the count of exact matches.
For the same data, if you have “apple”, “Apple”, “APPLE”, and “Apple”, the formula returns 2 because only two cells match “Apple” exactly.
Using FILTER for Case‑Sensitive Counts
An alternative that some users find more readable is FILTER combined with EXACT. The formula below counts how many cells in A2:A10 equal “Apple” exactly:
=COUNTA(FILTER(A2:A10, EXACT(A2:A10, "Apple")))
Here, FILTER returns only the cells where EXACT is TRUE, and COUNTA counts non‑empty entries. This works without ARRAYFORMULA because FILTER inherently handles arrays. Note that if your range contains empty cells, COUNTA won’t count them, which is usually what you want.
Comparing COUNTIF, COUNTIFS, and the Case‑Sensitive Workarounds
You might wonder when to use each method. Here’s a quick comparison:
- Standard
COUNTIF: Best for quick, case‑insensitive counts. Example:=COUNTIF(A2:A10, "apple")counts all variations. COUNTIFS: For multiple conditions, but still case‑insensitive. Example:=COUNTIFS(A2:A10, "apple", B2:B10, "yes").ARRAYFORMULA+EXACT: For a single case‑sensitive condition. Works well withSUM.FILTER+EXACT: More flexible if you later need to extract the matched rows, not just count them.
If you need to count case‑sensitively with multiple criteria, combine ARRAYFORMULA with EXACT and multiplication. For example, to count rows where column A equals “Apple” exactly and column B equals “Yes” (case‑insensitive for B), use:
=ARRAYFORMULA(SUM((EXACT(A2:A10, "Apple")) * (B2:B10 = "Yes")))
This works because multiplying the boolean arrays converts TRUE/FALSE to 1/0, and SUM adds them.
Common Mistakes and Pitfalls
When using these formulas, watch out for these issues:
- Forgetting
ARRAYFORMULA: If you write=SUM(--EXACT(A2:A10, "Apple"))without wrapping inARRAYFORMULA, Google Sheets may only evaluate the first cell, returning 1 or 0 incorrectly. Always includeARRAYFORMULAfor range operations. - Trailing spaces:
EXACTconsiders spaces as characters. “Apple ” (with a space) will not match “Apple”. UseTRIMif needed. - Case sensitivity in the search text: The second argument in
EXACTmust be typed exactly as you want to match. If you want to count “APPLE” in all caps, put “APPLE” in the formula. - Empty cells:
EXACTreturnsFALSEwhen comparing an empty cell to any text, so empty cells won’t be counted – which is usually desired.
When You Might Not Need Case Sensitivity
Sometimes users think they need case‑sensitive counting but actually don’t. For example, if you’re tallying product codes that are always entered in uppercase, a simple COUNTIF will work fine because the data is consistent. Case‑sensitive counting becomes essential when:
- You have duplicate entries that differ only by case (e.g., usernames “John” vs “john”).
- You’re checking data entry accuracy and want to flag lowercase where uppercase is required.
- You’re working with passwords or hash codes where case matters.
In those scenarios, the EXACT‑based formulas above are the right tool.
Alternatives: Conditional Formatting and Filter Views
If your goal is to visually identify case‑sensitive matches rather than count them, you can use conditional formatting. Select your range, go to Format > Conditional formatting, and under “Custom formula is”, enter:
=EXACT(A1, "Apple")
This will highlight only cells that exactly match “Apple”. Note that the formula uses the top‑left cell of the selected range (here A1) as a relative reference.
For a quick manual check, you can also create a filter view: Data > Filter views > Create new filter view, then in the filter dropdown, choose “Text contains” and type the exact string. However, the filter’s “Text contains” is case‑insensitive, so it won’t help with case‑sensitive filtering. The conditional formatting method is the reliable visual alternative.
Frequently Asked Questions
Does COUNTIF work with wildcards in Google Sheets?
Yes, COUNTIF supports wildcards: * (any sequence of characters) and ? (any single character). For example, =COUNTIF(A2:A10, "a*") counts all cells starting with “a” (case‑insensitive). Wildcards do not work with EXACT – EXACT compares literal strings only.
Can I use COUNTIFS for case‑sensitive counting?
No, COUNTIFS is also case‑insensitive. You must use the ARRAYFORMULA + EXACT approach, or combine multiple EXACT conditions with multiplication as shown above.
Why does my EXACT formula return 0 even though I see matching text?
Check for invisible characters like non‑breaking spaces or line breaks. Use =CODE(A2) to see the ASCII code of the first character – a space is 32, a non‑breaking space is 160. Also ensure you haven’t accidentally included extra spaces in the formula’s text argument.
Is there a built‑in case‑sensitive COUNTIF in Google Sheets?
No, there isn’t a dedicated function. The workaround with EXACT is the standard method. In Excel, you’d use SUMPRODUCT(--EXACT(...)), but Google Sheets requires ARRAYFORMULA because of how it handles array calculations.
Can I make COUNTIF case‑sensitive by changing settings?
No, there is no spreadsheet setting to alter the case sensitivity of COUNTIF. The behavior is hard‑coded. You must use a different formula.
Summary
To recap, the default COUNTIF is case‑insensitive. For case‑sensitive counting, use =ARRAYFORMULA(SUM(--EXACT(range, "text"))) or =COUNTA(FILTER(range, EXACT(range, "text"))). These formulas are accurate, work in any browser, and require no special add‑ons. If you’re migrating from Excel, remember that Excel’s SUMPRODUCT method doesn’t directly translate – you need ARRAYFORMULA in Google Sheets.
Related
- C Battery Size: Dimensions, Weight & Capacity
- K Value for Columns: What It Is and How to Use It
- What Is Enum in JavaScript? Real Usage
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- How to Create a Mail Merge Letter in Microsoft WordTo create a mail merge letter in Word, prepare a recipient list, connect it to a letter, insert…
- Excel Freeze Panes for Printing: What Actually WorksNo: Excel’s Freeze Panes setting keeps rows or columns visible while you scroll on screen; it does not…
- How to Export an Excel Tab to Its Own WorkbookTo export one Excel tab as a separate file, right-click its sheet tab, choose Move or Copy, select…
- How to Insert a Line in Word to Separate Text or SectionsTo quickly separate text in Microsoft Word, type three hyphens (—) on an empty line and press Enter;…
- How to Find a Circular Reference in Excel Step by StepIn Excel for Microsoft 365 on Windows, select Formulas > Error Checking ▼, point to Circular References, then…
- Excel Value Formatting: What It Changes and How to Use ItIn Excel, value formatting changes how a stored number, date, or text value appears in a cell; it…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.