Solved

# "Percentage Difference" formula needed

Posted on 2014-10-02
124 Views
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
0
Question by:SStroz

LVL 4

Expert Comment

ID: 40358747
I think you could be a litle more clear explaining some of your actual code in order to get the right answer.
0

LVL 24

Expert Comment

ID: 40358748
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

LVL 100

Accepted Solution

mlmcc earned 500 total points
ID: 40359304
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

LVL 7

Author Closing Comment

ID: 40369796
Thanks Michael!!!

Steve
0

## Featured Post

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…