# Scaling values so that the sum is equal to 0 (without changing their sign)

I have a large list of numeric (decimal) values ranging from approximately [-2, 2] with some of them being equal to 0 and I need to scale them so that their sum is equal to 0 while keeping their sign (i.e. negative numbers must remain negative after scaling).

The first try was to divide each number by the sum of all numbers in the list, at which point the sum of those is 1 then subtract $\frac{1}{c}$ where $c$ is the number of elements in the list but that has the drawback of not respecting the sign for values that are close to 0 to begin with.

Anyone has any tips on the best way to achieve this? Thanks

• It looks as though this would mean treating the positive and negative numbers differently. For instance multiplying all the negative ones by a constant to equalise their sum with that of the positives. Mar 22, 2017 at 18:28
• What else are you trying to achieve with this? Why does it have to sum to 0? Are there other constraints, like are you trying to maintain some distribution? There are many ways to transform data, and they will do other things to your data in the process. Can you provide us your data, a sample of it, or maybe include a histogram? Mar 22, 2017 at 19:39