How would we calculate the dipole moment of a charge combination (of 3 or more charges) whose magnitudes are different but net charge is zero? How would we calculate the dipole moment of a charge combination (of 3 or more charges) whose magnitudes are different but net charge is zero?
As a special case, what if the net charge is not zero? How would we calculate the dipole moment then?
 A: The dipole moment of a charge distribution is always defined as
$$
\mathbf p = \int \mathbf r \,\rho(\mathbf r)\mathrm d\mathbf r,
$$
and if the charge distribution is a collection of point charges $q_i$ at locations $\mathbf r_i$ (i.e. if the charge density $\rho(\mathbf r)=\sum_{i=1}^N q_i\delta(\mathbf r-\mathbf r_i)$ is a sum of delta functions) then it simplifies to
$$
\mathbf p = \sum_{i=1}^N q_i \mathbf r_i.
\tag 1
$$
If the system's total charge is neutral then this dipole moment has the nice property that it is independent of the coordinate origin used to calculate the $\mathbf r_i$, but even if that's not the case the dipole moment is still a useful quantity in that it encodes the weight of the dipole term in the multipole expansion for the distribution's electrostatic potential.

To be a bit more clear, the expression
$$
\mathbf p = \sum_{i=1}^N q_i \mathbf r_i = q_1 \mathbf r_1 + q_2 \mathbf r_2 + q_3 \mathbf r_3
$$
for the dipole moment (here specialized to the case of three charges and with an obvious generalization to larger numbers) should be read as defining the dipole moment as the vectorial sum of the charges' positions, previously multiplied by their charges.
It is a good exercise to check that this definition reduces, when setting $N=2$, to whatever definition you've been given for the two-charge case. In any case, the definition $(1)$ is the correct definition for $N>2$ and it fully encapsulates all the properties that you'd want it to encapsulate ─ particularly the force, torque and interaction energy it experiences when subjected to external fields, as well as the field the distribution produces when you're far away from it.
That last property is particularly important. It is possible to show that if you're given a collection of $N$ charges that are confined within a sphere of radius $R$, then the electrostatic potential it produces at a point $\mathbf r$ a distance $r\gg R$ from the center of the sphere is given by
\begin{align}
V
&=
\frac{1}{4\pi\epsilon_0} \frac{Q}{r} 
+ \frac{1}{4\pi\epsilon_0} \frac{\mathbf p\cdot\mathbf r}{r^3} 
+ O((r/R)^{-3}).
\tag 2
\end{align}
How does one interpret this?


*

*The $O((r/R)^{-3})$ term (to be understood in this sense) tells you that the expression in $(2)$ is not exact, but that it is a great approximation so long as $r$ is bigger than $R$. (On the other hand, don't be misled by all the talk about approximations: there are physically-realizable charge distributions whose fields are exactly dipolar, and for which that $O((r/R)^{-3})$ correction vanishes.)

*The initial $Q/r$ term is the core Coulomb potential, taken using the total charge $Q$ and the distance $r$ to the center of the distribution (even though there might not be any charge there). This component encodes the fact that, when seen from sufficiently far away, the details of the distribution don't matter, and all distributions mostly behave like point charges.

*...unless, that is, their total charge is zero, in which case the $Q/r$ term will vanish, but that doesn't mean that there won't still be a remaining electric field produced by the details of the contribution. If $Q=0$, then the leading term of the expansion $(2)$ becomes the dipole term, which reads in detail
$$
\frac{1}{4\pi\epsilon_0} \frac{\mathbf p\cdot\mathbf r}{r^3} 
=
\frac{1}{4\pi\epsilon_0} \frac{p\cos\theta}{r^2}.
\tag 3
$$
Here I've used the expansion $\mathbf p\cdot\mathbf r=pr\cos\theta$, where $\theta$ is the angle between the direction of the dipole moment $\mathbf p$ and the unit vector $\mathbf r/r$. Note that the dipolar potential falls of to infinity as $1/r^2$: this is faster than the Coulomb's $1/r$, but it's still nonzero, reflecting the fact that the internal layout of a neutral charge distribution can still produce nonzero fields far away from its boundaries.
Any charge distribution that produces a far-field potential of this form can legitimately be called dipolar (though we sometimes reserve the terms "point electric dipole" and "finite electric dipole", respectively, for distributions whose potential is exactly that of $(3)$ all the way down to $r\to 0$, and for a single pair of equal-but-opposite charges a finite distance apart).
If the total charge is nonzero, then the dipole moment still makes sense to define, and it still contributes to the far-field potential through $(2)$, though it now takes a sub-leading role. The other change when $Q=0$ is that $\mathbf p$ now depends on where you take your coordinate origin; in essence, you can think of the dipole term in $(2)$ as a correction caused by the fact that we didn't take our expansion centered on the center of charge of the distribution (which is definable only if $Q\neq 0$, as the point about which $\mathbf p$ vanishes).
