Percentage Increase Without DIV/0 Error

meppwc

Well-known Member
Joined
May 16, 2003
Messages
617
Office Version
  1. 365
Platform
  1. Windows
Looking for another way around the DIV/0 error on a formula that determines the percentage increase comparing 2 numbers.
The formula below which is in cell E8 works most of the time
=IF(B8=0,-"0%",(C8-B8)/B8)

B8: 1 (the value in B8 is "1" and is user entered)
C8: 2 (the value in C8 is "2" and is user entered)
D8: 1 (the value in this field is a formula "=C8-B8" and is referred to as "Difference"
E8: 100% (the value in this field is a formula "=IF(B8=0,-"0%",(C8-B8)/B8)" and is referred to as "% Difference"

This formula in E8 works correctly all of the time unless the value in B8 is zero.
If the value in B8 is zero, then the result in E8 is 0% instead of 200%

Is there another way of getting around the DIV/0 error other than the method that I am using? B8=0,-"0%


But if cell B8 contains the value of zero, I do not get the DIV/0 error, but the value in E8 becomes zero which is incorrect
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
If B8 is 0 then (C8-B8)/B8 will give you a DIV/0 error so check for B8 being 0 FIRST, hence

=IF(B8=0,-"0%",(C8-B8)/B8)

But you say if B8=0 you want the result to be 200% so just change the formula to

=IF(B8=0,"200%",(C8-B8)/B8)
 
Upvote 0
yes, thats it........now that I see it it is so obvious.....thanks a lot
 
Upvote 0

Forum statistics

Threads
1,221,442
Messages
6,159,905
Members
451,601
Latest member
terrynelson55

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