For the following sheet:
A
1 0
2 0 as formula result
3 0
4 0 as formula result
5 0 as formula result
6 blank
7 0
How do I count only the cells with 0
entered as VALUES and not the cells with 0
as their formula result, i.e.
COUNTIF(A1:A7,0 AS VALUE)
= 3
I've tried the following:
COUNTIF(A1:A7,0)
= 6
COUNTIF(A1:A7,"0")
= 6
COUNTIF(A1:A7;0) this worked for me
Not sure about Excel, but VBA has this functionality. So you can define a small UDF to achieve this:
Function HasFormula(r as Range) As Boolean
HasForumla = r.HasFormula
End Function
Now you can call this function with IF and COUNT to get your results.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With