If you do not want to use javascript, you can iterate through the table and count the rows in each group.
The downside is that you will probably need to count all the lines, and then go back and update the group name on each line.
For instance:
ID Value Group 1 One GroupA 2 Two GroupA 3 Three GroupB 4 Four GroupB 5 Five GroupB
2 in GroupA
3 in GroupB
ID Value Group 1 One GroupA (2) 2 Two GroupA (2) 3 Three GroupB (3) 4 Four GroupB (3) 5 Five GroupB (3)
source share