There are no clear cut formulae, though. Take the range R = L - S.
Let k = No of groups. Then R = ck, where c = Class interval. Decide either c or k arbitrarily, based on the data at hand.
L = Largest value, S = Smallest value. K is normally chosen as a number between 5 and 10.