Your approach is correct.
The first person to arrive has no one with whom to shake hands. The second person to arrive can shake hands with the one person already present. The third person to arrive can shake hands with the two people already present. In general, the $k$th person to arrive can shake hands with the $k - 1$ people already present. Thus, if there are $n$ people present at the party, the number of handshakes is
$$\sum_{k = 1}^{n} (k - 1) = \sum_{k = 0}^{n - 1} k = \frac{n(n - 1)}{2}$$
as you observed in the comments.
Inductive Proof: Let $P(n)$ be the statement that if $n$ people are present at the party and each person shakes the hand of every other person at the party, then the number of handshakes is $\frac{n(n - 1)}{2}$.
Let $n = 1$. Since the first person has no one with whom to shake hands, no handshakes occur. Since
$$\frac{1(1 - 1)}{2} = \frac{1 \cdot 0}{2} = 0$$
$P(1)$ holds.
Thus, we may assume $P(m)$ holds for some positive integer $m$.
Let $n = m + 1$. When the $(m + 1)$st person arrives at the party, the number of handshakes that have already occurred is, by hypothesis,
$$\frac{m(m - 1)}{2}$$
The new guest then shakes the hands of each of the $m$ people present, after which every person has shaken the hand of each of the other people at the party and the number of handshakes that have occurred is
$$\frac{m(m - 1)}{2} + m = m\left[\frac{m - 1}{2} + 1\right] = m\left[\frac{m - 1}{2} + \frac{2}{2}\right] = \frac{m(m + 1)}{2}$$
so $P(m) \Rightarrow P(m + 1)$.
Since $P(1)$ holds and $P(m) \Rightarrow P(m + 1)$ for each positive integer $m$, $P(n)$ holds for each positive integer $n$.
Combinatorial Proof: The number of handshakes is equal to the number of ways that two of the $n$ people present can be paired, which is
$$\binom{n}{2} = \frac{n!}{2!(n - 2)!} = \frac{n(n - 1)(n - 2)!}{2(n - 2)!} = \frac{n(n - 1)}{2}$$
Combinatorial Proof: The number of handshakes is equal to the number of subsets consisting of two of the $n$ people present at the party. We can count these subsets by adding up the number of handshakes performed by each person as she or he arrives at the party. Since the $k$th person to arrive at the party shakes the hand of the $k - 1$ people already present, we may conclude that the number of handshakes that occur when $n$ people are present at the party is
$$\binom{n}{2} = \sum_{k = 1}^{n} (k - 1) = \sum_{k = 0}^{n - 1} k = \frac{n(n - 1)}{2}$$
A variation of this argument was used by al-Banna to derive the formula for $\binom{n}{2}$.
This can be generalized even more. If you have $n$ people, $p_1, p_2,..., p_n$ and you want $p_i$ to shake hands with $a_i$ people, then do the follwoing:
Make a graph in which every vertex is a person and draw an adge between any 2 people that shake hands. Observer that $deg(p_i)=a_i$, $\forall i$, so the number of handshakes, i.e. the number of edges is $$\frac{\sum_{i=1}^{n}deg(p_i)}{2}=\frac{\sum_{i=1}^{n}a_i}{2}$$
Important: for the handskaes to be possible, $\sum_{i=1}^{n}a_i$ must be even.
So to answer your question, if we have $n$ people and each should shake hands with $m$ people, for this to be possible $mn$ must be even and we have $$\frac{\sum_{i=1}^{n}a_i}{2}=\frac{mn}{2}$$
(because $a_1=a_2=...=a_n=m$)
Best Answer
Hint: No person shook more than eight hands, so you must have gotten answers from 0 to 8 inclusive. Who is married to the person who shook 8?