Is there a way to convert the following array formula to work when there are blank cells? or is there a better formula that will work for what I need?

=SUM(1/COUNTIF(A1:A10,A1:A10))