Count cells not equal to in Excel and Google Sheets

=COUNTIF(A:A,"<>10")-COUNTBLANK(A:A)

=COUNTIF(A:A,"<>"&B3)-COUNTBLANK(A:A) // Criteria as a cell reference

A:A = Range

Check below for a detailed explanation with pictures and how to use formulas in Excel and Google Sheets.