=SUMPRODUCT(--(TRIM(A1:A10)<>""))
This portion will return an array of TRUE or FALSE:
TRIM(A1:A10)<>"")
The double unary "--" coerces these logical values to numeric values which
SUMPRODUCT can then add up to arrive at the result.
--TRUE gets coerced to 1
--FALSE gets coerced to 0
Try entering these formulas and see what happens:
=--TRUE
=--FALSE
Enter the number 10 in cell A1 then try this formula:
=--(A1=10)