Combinatorics Number of Possible Assignment Combinations

Say I have Group A and Group B

Group A needs 1 student and group B needs 2 students. There are 3 students total (A,B,C).

What sort of formula could I use to determine the total number of assignment combinations of students to groups.

So for the above example I could have

Group 1   Group 2
A         BC
B         AC
C         AB


Or if I had 3 groups, 3 students and each group needs 1 student

Group 1   Group 2   Group 3
A         B         C
A         C         B
B         A         C
B         C         A
C         A         B
C         B         A


Obviously I'm going to use this on a much larger scale, I've been reading up on combinatorics but I haven't been able to find a formula to use for this that could cover both cases.

Thanks

Assuming you designate all the $n$ students to groups of predesignated group sizes $\{g_i\}$ (so that $\sum g_i = n$), you have $$\frac{n!}{\Pi (g_i!)}$$
In the first case, $n=3, \{g_i\} = \{1,2\}$ and there are $\frac{3!}{1!2!}=3$ choices
In the second case, $n=3, \{g_i\} = \{1,1,1\}$ and there are $\frac{3!}{1!1!1!}=6$ choices