# "Percentage Difference" formula needed

I have two currency fields, Current YTD and Previous YTD.

I need a formula that shows the percentage increase or decrease.  I've tried a few things but I'm getting Division by 0 errors.  Either value can be "0".

I need something to display 50, 100, or -50, -100, etc, etc

I'm braindead - can any of you help?

Steve
LVL 7
###### Who is Participating?

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
I think you could be a litle more clear explaining some of your actual code in order to get the right answer.
0
Commented:
you need to use "if then else" syntax to check if the divisor is zero, like this:
``````If {Current YTD} ={Previous YTD} then 0 else ({Current YTD} - {Previous YTD}) / {Current YTD} * 100
``````
0
Commented:
Actually the formula needs to test the divisor.  Also you are probably looking for the percentage increase/decrease over the previous year

Try this

If {PreviousYear} = 0 then 0 else ({CurrentYear} - {PreviousYear}) / {PreviousYear} * 100

mlmcc
0

Experts Exchange Solution brought to you by