You are looking for an extended COUNTAIF(range, criteria, [count range]), similar to SUMIF. Unfortunately that doesn't exist so we'll have to create it!
Lets say col A has the names, and col B is the values you want to count if not blank for each grouping of names in A. I assume you have a 1000 rows including a header in row 1. Create in col C:
Then in col D:
=SUMIF($A$2:$A$1000, A2, $C$2:$C$1000)
EDIT: All-in-one solution:
If you want to do this without a helper column, try the follow array formula (type and commit with ctrl+shift+enter (CSE)).
You need to use CSE in order to tell Excel to treat the formula arguments as arrays and not just scalar single-cell numbers. Normal AND doesn't work with arrays, so BITAND is your friend. The arguments of BITAND evaluates your criteria and result in two boolean arrays which are AND'ed together row by row. The "+0" converts the resulting boolean array to a numbered array containing only 0's and 1's, which can be summed together to result in a single scalar value.