Suppose your data is in A2:A7 then this formula in C2 will list the group that is entered next to the first time a name is in the list:
=VLOOKUP(A2,$A$2:$B$7,2,FALSE)
For this to work, sort your table (using a custom sort), first on column A, then on column B. This ensures the groups are in ascending order for each name.