2. If the difference between the maximum and minimum elements of the real number set $\{1,2,3, x\}$ equals the sum of all elements in the set, then the value of $x$ is $\qquad$ .
If $x$ is the maximum element $\Rightarrow x-1=x+6$, no solution; if $x$ is the minimum element $\Rightarrow 3-x=x+6 \Rightarrow x=-\frac{3}{2}$; if $x$ is neither the maximum nor the minimum $\Rightarrow 3-1=x+6 \Rightarrow x=-4$, contradiction. In summary, $x=-\frac{3}{2}$.