Count number of values within a field that accepts unlimited values
There is a way of doing this natively in Drupal 7.


Set 'Use aggregation' to Yes
Add a field that contains multiple values, such as a file field
Set the aggregation settings for it to COUNT DISTINCT


Simple. This will however enable aggregation for all fields, but the default settings for other fields will make them behave normally.