Ahhh ... the joys of Excel!
Excel treats numbers as if they are less than "", see row 2 in this example sheet, and text as being greater than "".
COUNTA() and COUNTIF() can both return unexpected results.
1/. COUNTA() counts all cells that are not null, however it will include any cell with a formula that returns "" See Column W, the grey cells in the table A4:N10 contain formulae.
2/.COUNTIF() If the criteria is ">""" text will be counted, excluding blanks (Col S), so far so good.
So you might reasonably expect "<""" to count numbers ... Wrong! It counts blanks returned by formulae.(Col T)
How do you get it to count numbers?
">=0" counts positive numbers and zeros, "<0" counts negative numbers, so add them together, or use "<"&99^99, but this is pointless because COUNT() does the business.
So COUNTIF() counts if the stated criteria is TRUE, numbers, as such, are a problem.
3/. It is often stated - "Use COUNTIF/S() rather than SUMPRODUCT()"
this works for this example sheet
This looks like an alternative, but isn't!
Summing up, if your worksheet doesn't have cells with formulae that return "" use this ...
Otherwise use the SUMPRODUCT formula above.
Rant over! ...
Bookmarks