Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.
Last reviewed:
When COUNTIF returns a count but the number is higher or lower than expected, the formula found matches — just the wrong ones. Over-counting is usually caused by wildcard patterns matching too broadly or duplicates in the range. Under-counting is usually caused by data-type mismatches or hidden characters preventing recognition of a cell.
=COUNTIF(A1:A100,"Jan*")=COUNTIF(A2:A100,"January")The broken formula started at A1 (including the header 'Jan Sales') and used a wildcard that matched January, Janitor, etc. The fixed version excludes the header and uses an exact criteria.
Edit the grid or formula, then run it through a real spreadsheet engine — no signup.
Sample data — click any cell to edit
Stop hunting errors by hand.
Upload your spreadsheet and the Auditor flags every Wrong count and broken formula at once — or paste this one formula and get the fix explained.
Use SUMPRODUCT with 1/COUNTIF: =SUMPRODUCT(1/COUNTIF(A2:A100,A2:A100)) counts unique values in a range. Add an IF to handle blanks: =SUMPRODUCT((A2:A100<>"")/COUNTIF(A2:A100,A2:A100&"")).
COUNTIF is a range function, not a filtered-view function. To respect filters, use SUBTOTAL(102, range) for a count of visible non-blank cells, or AGGREGATE in Excel.
The header row is almost certainly included in the range and the header text matches the criteria. Start your range from row 2 instead of row 1.
Count the cells in a range that meet a condition.
How-toLearn the difference between COUNTIF (single condition) and COUNTIFS (multiple conditions) for counting in Excel and Google Sheets.
Error fixCOUNTIF not working in Excel and Google Sheets — fix criteria syntax, data-type mismatches, wildcard errors, and case-sensitivity misunderstandings.
ReferenceCount cells that meet several conditions simultaneously.
How-toUse COUNTIF with the <> operator to count all cells that do not match a specific value.
How-toCount cells that contain, start with, or end with specific text using COUNTIF with * and ? wildcard characters.
Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.
Last reviewed: