This explains how to get Greg's original idea for rescaling positive and negative parts each in a linear way to give the desired outcome.
Let $P = (P_1,P_2,...,P_n)'$, and $N = (N_1,N_2,...,N_m)'$,
where the elements of $P$ and $N$ are all non-negative.
Let $\bar{P}$ and $\bar{N}$ be the mean of the vectors $P$ and $N$
respectively
Consider a set of data with both positive and negative elements (as might be obtained by mean-correcting or median-correcting an existing set of data), where $X=(-N,P)'$.
Now let $Y = (-aN,bP)+c$ for $a,b>0$.
Then $\min(Y)=-aN_{(m)}+c$, $\max(Y)=bP_{(n)}+c$ and $\bar{Y}=(nb\bar{P}-ma\bar{N})/(m+n)+c$.
To obtain a desired min, max and mean for $Y$, simply solve the above three (linear) equations for $a,b,c$
If $\min(Y)=l,\max(Y)=u$ and $\bar{Y}=d$ then we solve
\begin{eqnarray}
-aN_{(m)} + c &=& l\\
bP_{n}+c &=&u\\
(nb\bar{P}-ma\bar{N})/(m+n)+c&=&d
\end{eqnarray}
for $a,b,c$.
Let $v = (a,b,c)'$ and let $z=(l,u,d)'$. In matrix form we are trying to solve:
$$Av = z$$
where
$$A=
\begin{bmatrix}
-N_{(m)} & 0 & 1 \\
0 & P_{(n)} & 1 \\
-\frac{m}{m+n}\bar{N} & \frac{n}{m+n}\bar{P} & 1 \\
\end{bmatrix}\,.
$$
with a few more lines of algebra we could write an explicit solution, but I'll have to come back to that later. As it is, this is straightforward to implement as is in many programs, since solving linear systems is easy, it would be a simple matter to write a few lines of code to get the scale factors $a,b$ and $c$.