Grouping puts the values into classes of equal width w=10. The first class starts at the multiple of w at or below the smallest value 12, which is 10, and the classes continue until the largest value 31 is covered. The values are whole numbers, so each class stops one before the next begins.
start=⌊1012⌋×10=103 classes
2
Tally of each class
Count how many of the n=7 values fall in each class; this is the class frequency f.
10–19:3,20–29:3,30–39:1
3
Relative and cumulative frequency
The relative frequency is each frequency as a share of the total, and the cumulative frequency is the running total of the frequencies, so the last one must equal n=7.