COUNTIF ">B1" returns 0 — put the operator in quotes and the cell outside
Updated
COUNTIF looks fine, the numbers in the column are clearly larger than the threshold, and the result is 0. There is no #N/A, no #VALUE!, and no triangle. The criterion was written as ">B1". Inside those quotes, B1 is the characters B and 1, not the value in cell B1. Sheets compared every cell to the text >B1, not to the number in B1.
This page is the quoted-operator-plus-cell pattern. Counting a date written as the text >2024-01-01 is COUNTIF date serial. A criterion that treats * or ? as a wildcard is COUNTIF wildcards. Keep the Google Sheets UI in English.
Recreate it on a blank sheet
Section titled “Recreate it on a blank sheet”- Open a blank spreadsheet. In A1 type
qty. A212. A34. A419. A57. A615. Five numbers. In C1 typemin. In C2 type10.
The quoted cell is a literal. In E1 type quoted. In E2 enter =COUNTIF(A2:A6,">C2"). E2 is 0. Three values are greater than 10. None of them is the text >C2. There is no error flag. Leave E2 as 0.
Join the operator to the cell. In E4 type joined. In E5 enter =COUNTIF(A2:A6,">"&C2). E5 is 3. That is 12, 19, and 15. ">"&C2 builds the criterion >10. Leave E5 as the control.
The same trap in SUMIF. In G1 type sum_quoted. In G2 enter =SUMIF(A2:A6,">C2"). G2 is 0. In G4 type sum_joined. In G5 enter =SUMIF(A2:A6,">"&C2). G5 is 46 (12 + 19 + 15). SUMIF uses the same criterion language as COUNTIF. The quoted cell is still letters.
A cell that already holds the operator. In C5 type >=10 as text. In E8 enter =COUNTIF(A2:A6,C5). E8 is 3. In E9 enter =COUNTIF(A2:A6,">"&C5). E9 is 0, because the criterion became >>=10. When the threshold cell already includes >, >=, <, <=, or <>, do not add a second operator.
Not-equal-to-blank is the same join. In A8 leave the cell empty. A9 ok. In E11 enter =COUNTIF(A8:A9,"<>"&""). That counts non-blank cells and is 1. Writing "<>A8" would look for the literal text <>A8.
What is actually wrong
Section titled “What is actually wrong”- A criterion in quotes is a string.
">C2"is the two characters>plus C plus 2.COUNTIFandSUMIFdo not evaluate cell addresses inside a string. ">"&C2concatenates the operator and the value. If C2 is the number 10, the criterion is the string>10, which is what these functions expect for a numeric comparison.- The result is quietly wrong, usually
0, because almost no numeric cell equals the text>C2. That silence is why the bug lasts. A#VALUE!would have been easier to notice. AVERAGEIF,COUNTIFS,SUMIFS, andAVERAGEIFSuse the same criterion strings.COUNTIFS(A2:A6,">C2",B2:B6,"yes")is the same literal-text mistake on the first criterion. Argument order onSUMIFSis a different page: SUMIFS criteria range order.- If the threshold is a date, join to a real date cell (
">"&C2) or toDATE(2024,1,1). A quoted ISO date is COUNTIF date serial.
This is not a wildcard surprise. There is no * in the criterion. See COUNTIF wildcards when the count is too high because a star matched prefixes. This is not COUNTIFS date and text. The values here are plain numbers.
Leave E2 as 0 and G2 as 0 so the broken criteria stay visible.
Write the operator, then &, then the cell. =COUNTIF(A2:A6,">"&C2) and =SUMIF(A2:A6,">="&C2). Change C2 from 10 to 12 and E5 should become 2 (19 and 15). That toggle is the check that the formula is reading the cell.
If a dropdown or a helper cell already stores >=10, pass that cell raw. =COUNTIF(A2:A6,C5). Do not wrap it in ">"&.
For several conditions, join each criterion the same way. =COUNTIFS(A2:A6,">"&C2,D2:D6,E2) where E2 is an exact label, and =SUMIFS(C2:C6,A2:A6,">="&C2).
If the count is still 0 after the join, the column may be text-looking numbers, or the threshold may be a date stored as text. Check with ISTEXT / ISNUMBER and see CSV text vs number or COUNTIF date serial. Do not wrap the 0 in IFERROR. There was no error to hide.