How to find the range of a grouped data