Calculating percentage change with 0 values?

djacob69

New Member
Joined
Jun 14, 2010
Messages
13
Ok. Here is the situation. I have two columns that I need to calculate the percentage change..

Column G is year 2010
Column F is year 2011
Column I is percentage change from G to F (cell is formatting for percentage)

The values in G and F can range from .5966 to 1.56, including a value of 0.000

If I use the forumula (F1-g1)/g1. F1=1.4155 and G1 = 0.000 I will receive a #div/0 error.

If the values for F1=0.000 and G1 = 1.4155. The result will be 100%

I need the forumula to work both ways with the possibility of 0 being used in either column...

Any ideas?
 
Last edited:
I forgot to add in the AND on the first explanation Code
=IF(AND(OLD VALUE=0,New Value>0),1,IF(MIN(OLD VALUE,NEW VALUE)<=0,(NEW VALUE-OLD VALUE)/ABS(OLD VALUE),(NEW VALUE/OLD VALUE)-1))
 
Upvote 0

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
I use this code


=IF(OLD VALUE=0,1,IF(MIN(OLD VALUE,NEW VALUE)<=0,(NEW VALUE-OLD VALUE)/ABS(OLD VALUE),(NEW VALUE/OLD VALUE)-1))

So an example would be in column A we have purchases from 2018 and in column B we would have purchases from 2019. This formula would go in Column C to show the percent change. What it means is; If the value in 2018 = 0 and the value in B2 is greater than zero then the answer is 100%. If this is not true, then it moves on to the next argument which is; if the minimum value in B2 and A2 is less than 0 then you subtract B2 from A2 and the divide it by A2 using the ABS formula. If that is still false then the fail safe is dividing B2 by A2 and subtracting 1 (which is 100%) to show the true growth rate.

=IF(AND(A2=0,B2>0),1,IF(MIN(A2,B2)<=0,(B2-A2)/ABS(A2),(B2/A2)-1))
This formula is awesome and worked for so many percentages I needed, however when the old value is zero and the new value is zero the first formula gave me 100% and the second formula gave me #DIV/0!. Is there another IF statement within this formula that would work for that scenario?
 
Upvote 0
I have just run into the same issue as you, and successfully used the below:

=IF(AND(OLD VALUE CELL=0,NEW VALUE CELL>0),100%,(IFERROR(((NEW VALUE CELL-OLD VALUE CELL)/OLD VALUE CELL),0)))

In practice using E11 (old value) and F11 (new value), this is the formula:

=IF(AND(E11=0,F11>0),100%,(IFERROR(((F11-E11)/E11),0)))
 
Upvote 0

Forum statistics

Threads
1,215,540
Messages
6,125,409
Members
449,223
Latest member
Narrian

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top