Is there a common online (edit-ABG) data base available for this app,
or is it all based on the one device being passed around?
Also, consider keeping a table of pairs,
who picked who.
Each time some one picks some one else, add a row to the table
identifying who picked who (whom?)
If you use a SQL data base like MySQL or Fusion Tables (soon defunct)
you can ask the data base through queries to do the GROUP BY and SUM.