Make a family that is all sprites with eq_variable. Then loop through that family with a counter. If eq_variable=1 add one to the counter. When you are done the value in the counter is the answer.
Or
write a function that given a sprite in the family it returns one iff eq_variable=1. Then pick all members of the family for which this functions is 1. Then pickedCount gives you the number of the sprites with eq_variable=1.
yours
winkr7