Say DaysOfMonth is a set of up to 31 related records...
That would be a much better way to structure this and the methods used to count the number of times a specific value is present for a given month becomes much easier as a simple find, a relationship, or a filtered portal can all do the trick.
With a repeating field, you'd need to use a script or custom function to loop through all the repetitions, incrementing a counter each time a repetition with the specified value is found.
ValueCount ( FilterValues ( List ( YourRepeatingField ) ; 72 ) ) )
Thanks raybuadi. Just what I was looking for. Now to study it and find out why it works....