Solved

# How can I calculate percentage value +ve/-ve growth between 2 values when one or both are negative?

Posted on 2008-06-25

Hi,

I am trying to calculate the % increase / decrease between profit figures from previous to current year. Currently my formula is as follows:

If Sum ({@Current}) <> 0 and Sum ({@Previous}) <> 0 Then

((Sum ({@Current) - Sum ({@Previous}) / Sum ({@Previous})) * 100

It is fine if the current & previous years are both positive or if the previous year is positive and current is negative.

If however the previous year is negative then the values are correct but are incorrectly shown as +ve or -ve percentages (dependant upon current year figure)

I simply want to show a positive % if there has been an increase or a negative % if there has been a decrease, regardless of whether one or both figures are negative. So an example

Previous Year = -200

Current Year = 0

Increase = 100%

Does anyone know how to do this in Crystal?

Thanks in advance!!