Can electric potential energy be nonzero when the electric field is zero? I read on wikipedia that electric potential energy of a point charge in the presence of n point charges can be calculated from this formula:
$$
U = k_eq \sum_{i=1}^{n} \frac{Q_i}{r_i}
$$
However, according to my physics textbook the electric potential energy of a point charge in an electric field can be calculated by multiplying electric field by the charge $q$ and distance to the point where the energy is zero $x$. But that doesn't make sense to me, because for example the electric field in the middle of two like charges is zero, but the energy calculated with the above equation is not zero. Am I missing something obvious?
 A: Yes, the electric potential energy can be non-zero when the electric field is zero.  There are a couple of ways to make this sit right in your heart.
The primary one is to note that the value of the potential energy is meaningless. It is only changes in potential energy that matter, essentially because of various statements of conservation of energy such as $W_{\textrm{ext}} = \Delta K + \Delta U$.  Alternatively, it's only the derivative of $U$ that matters because $F_x = -\partial U/\partial x$, which  means that $U$ is really only defined up to an overall constant.
We can illustrate this with the situation you've outlined.  Consider the case of two point particles of equal positive charge $Q$ located at positions $x=-L$ and $x=L$ along the $x$-axis.  The field at $x=0$ is zero, because both particles make electric field vectors of equal magnitude there but pointing in opposite directions.  Suppose that we have locked these two particles in place.  Now, we bring in a third charge $q$ and place it at $x=0$. Then, the electric potential energy would be
$$
U = q\frac{kQ}{|{-L}|} + q\frac{kQ}{|L|} = 2\frac{kqQ}{L}\,,
$$
which is non-zero.  Now imagine that we offset the particle $q$ to position $x$ near $x=0$. Then, the potential energy is
$$
U = q\frac{kQ}{|{-L-x}|} + q\frac{kQ}{|L-x|}\,,
$$
which looks like

for positions between $x=-L$ and $x=L$.  Note that the potential energy is horizontal at $x=0$, indicating that $\partial U/\partial x$ is zero at $x=0$, and hence the force experience by the particle there is zero as well.  This is how the potential energy and the force ($q\vec{E}_{\textrm{due to the two }Q{'s}}$) are related.  The fact that $U$ has the value $2kQ/L$ at $x=0$ doesn't mean anything, but the fact that the slope of $U$ is zero does.

Important addendum: the potential energy decreases away from $x=0$ along the $y$ and $z$ axes, so this point at $x=0$ is actually a point of unstable equilibrium, but the explanation above still holds.  The gradient of $U$ at $(x,y,z)=(0,0,0)$ is still zero, and hence a particle placed at that spot feels no force, despite the value of the potential energy being non-zero.
A: 
Can electric potential energy be nonzero when the electric field is zero?

Yes. The obvious example is when the electric potential $\phi$ is a non-zero constant.
We have:
$$
\phi(\vec x) = C \to U = q\phi = qC\;,
$$
where $C$ is a constant.
But
$$
\phi(\vec x) = C\to \vec E = -\vec\nabla \phi = 0
$$

Further discussion:

I read on wikipedia that electric potential energy of a point charge in the presence of n point charges can be calculated from this formula:
$$
U = k_eq \sum_{i=1}^{n} \frac{Q_i}{r_i}
$$

The above expression is not generally correct, it is only correct for a test charge located at $\vec r = 0$. Since there is no $\vec r$ dependence it can not be used to determine the field. So, we need to generalize.
Generally, for any location $\vec r$ of the test charge $q$:
$$
U(\vec r) = k_e q \sum_{i=1}^{n} \frac{Q_i}{|\vec r - \vec r_i|}
$$
For example, for two equal charges $Q$ located, say, at $\pm L\hat x$ we have:
$$
U(\vec r) = k_e q Q \left(\frac{1}{|\vec r - L\hat x|} + \frac{1}{|\vec r + L\hat x|}\right)
$$
and we have:
$$
\phi(\vec r) = k_e Q\left(\frac{1}{|\vec r - L\hat x|} + \frac{1}{|\vec r + L\hat x|}\right)
$$
and we have:
$$
\vec E(\vec r) = k_e Q\left(\frac{(\vec r - L\hat x)}{|\vec r - L\hat x|^3} + \frac{(\vec r + L\hat x)}{|\vec r + L\hat x|^3}\right)
$$
For this example, evaluating at $\vec r = 0$ we have:
$$
U(0) = k_e q Q \left(\frac{1}{|L\hat x|} + \frac{1}{|L\hat x|}\right)
=k_e q Q \frac{2}{L}
\neq 0
$$
and we have:
$$
\phi(0) = k_e Q\left(\frac{1}{|L\hat x|} + \frac{1}{| L\hat x|}\right)
=k_e Q \frac{2}{L}
\neq 0
$$
and we have:
$$
\vec E(0) = k_e Q\left(\frac{(-L\hat x)}{|L\hat x|^3} + \frac{(L\hat x)}{|L\hat x|^3}\right)
=k_e Q \frac{(-L\hat x+ L\hat x)}{|L|^3}
= 0
$$
A: Yes and there is an important example in quantum mechanics : check aharonov bohm effect.
An electric field is a spatial derivative of the electric potential, and thus obviously it can have any constant nonzero value and still correspond to a given electric field as a derivative of a nonzero constant is zero.
This is more than a math tool as can be seen in the example mentioned above.
