Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey guys. I'm getting some problems calculating some percentages about refunds of sales.
The point is, if I make a division between two negative numbers, the result is positive. And I'm getting a wrong result.
Is there some way I could know if I'm doing this kind of divisions?.
If I know that I only have to change the symbol (positive or negative) of the result, and it will be done.
Thanks in advance!!
Cheers!
THE CORRECT CALCULATION IS
( [ACTUAL] - [PREVIOUS] ) / FABS([PREVIOUS])
WHERE ABS() IS THE ABSOLUTE VALUE FUNCTION
Do you mean absolute value (i.e. you always want it to be positive)? If so, the function is fabs()
Regards,
Ok, here I leave you a real example with an image of a result. (first column is current year, second column is last year, and result)
For me this results are wrong, because you have to change the sign (+/-) of them. I mean, in the first one, I'm having a bad lecture, because I'm going worse than last year, so the result would be in red -28.42%.
How could I get it right?
Many thanks by advance.
Regards!!
Do you're dividing column(1) by column(2), subtracting 1, and treating that as a percentage? This is kind of confusing...what is this supposed to represent? And for the first row, why do you say you're doing worse than last year: -21.904 > -28.128, right? Maybe if I understood the business logic behind this, I could offer better advice.
Regards,
Hi,Let me know how you are calculating percentages i.e column(1)/column(2) or column(2)/column(1)
?
Regards,
Sharma
THE CORRECT CALCULATION IS
( [ACTUAL] - [PREVIOUS] ) / FABS([PREVIOUS])
WHERE ABS() IS THE ABSOLUTE VALUE FUNCTION
Thank you guys. Your answers were very useful. It works fine.
Sorry for the delay because of the weekend.
See you around.