Hi - I'm programming in PHP. Here is some YTD information:
2011 YTD 14,989.3 2,877,688.8 $73,101.97
2010 YTD 18,409.8 1,911,203.4 $52,875.36
YTD Change Down 1.228% Up 1.506% Up 1.383%

The YTD Change % looks incorrect to me. This is the formula I'm using to calculate the percentage. I know you mathematical people will be horrified but I never did very well in math. :( Help!

The numbers are actually right, just the interpretation is off.
1.228 means you have currently 1.228 times last year, so that's a 22.8% increase.
If you get .9 then that's a 10% decrease. Take your number, subtract 1 and multiply by 100.
So (ThisYear/LastYear - 1)*100 gives the percentage change.

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

The number you generate is the ratio of the new number to the old number. To see the change, you subtract the old number. It's the same as (new - old)/old. With a little algebra, you can see that they are identical.
If you lost 10%, this would actually give you a value of -10% gain. But you want to show the number as positive, so we flip it - (new - old)/old = (-new + old)/old = (old - new)/old = 1 - new/old.
I just short cut the algebra.

Thanks for the explanation! I'm horrific in algebra. :(

Zack

0

Featured Post

Active Directory plays a critical role in your companyâ€™s IT infrastructure and keeping it secure in todayâ€™s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Lithium-ion batteries area cornerstone of today's portable electronic devices, and even though they are relied upon heavily, their chemistry and origin are not of common knowledge. This article is about a device on which every smartphone, laptop, anâ€¦

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.