There are $2^N$ subsets of a set.
For instance the set $\{ 1, 2 \}$ has the following subsets: $\{ \}$ $\{ 2 \}$ $\{ 1 \}$ $\{ 1, 2 \}$
I'm trying to calculate the total number of elements in all of the subsets. In the above example, it would be $4$:
$\{ 2 \}$ has one element, $\{ 1 \}$ has one element and $\{ 1, 2 \}$ has two elements, giving us $4$.
Is there a generic equation that could calculate this for me?
Well, let's work it out. I assume, here, that you're dealing with a finite set $A$ of cardinality $n.$ For each integer $k$ with $0\le k\le n,$ there are $$\binom{n}{k}=\frac{n!}{k!(n-k)!}$$ subsets of $A$ of cardinality $k$. Thus, one formula that would work is $$\sum_{k=0}^nk\binom{n}{k}.$$ However, that's not very revealing. Let's see if we can work out a closed form.
Calculating this number explicitly for small $n$ suggests that the closed form would be $$\sum_{k=0}^nk\binom{n}{k}=n2^{n-1},$$ and indeed, we can prove this to be the case fairly easily by using the following facts: $$n\binom{n-1}{k-1}=k\binom{n}{k},$$ $$\binom{x}{-1}=0$$ for all $x,$ and $$2^m=\sum_{k=0}^m\binom{m}{k}$$ for all integers $m\ge 0.$ See if you can take it from there on your own. If you get stuck, or if you just want to bounce your reasoning off of someone, let me know!
Another (more direct) way to see this is to note that, for any given element $x$ of $A,$ there are $2^{n-1}$ subsets of $A$ having $x$ as an element. Thus, there are $2^{n-1}$ occurrences of $x$ as an element, and since there are $n$ such $x,$ then we obtain $n2^{n-1},$ as desired.