How to stop 0% being a #DIV/0

RichardL4Y

New Member
Joined
Feb 22, 2019
Messages
3
So I'm just doing a simple formula of B1/A1 as a percentage. If B1 is 0 then the answer reverts to an error (#DIV/0). How do I get it to be BLANK if answer is zero?

Please help - thanks in advance
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
So I'm just doing a simple formula of B1/A1 as a percentage. If B1 is 0 then the answer reverts to an error (#DIV/0). How do I get it to be BLANK if answer is zero?

Please help - thanks in advance
You could always test for that condition...

=IF(A1=0,"",B1/A1)
 
Upvote 0
You could always test for that condition...

=IF(A1=0,"",B1/A1)

Thanks guys - sorry my question wasn't quite right. It's a calculation for a Gross Profit %. As example formula is this =SUM(O6-S6)/O6 - how do I stop the DIV error if the answer is zero. I'd love it just to be Blank if Zero.
 
Upvote 0
Thanks guys - sorry my question wasn't quite right. It's a calculation for a Gross Profit %. As example formula is this =SUM(O6-S6)/O6 - how do I stop the DIV error if the answer is zero. I'd love it just to be Blank if Zero.

Your #DIV/0! error occurs because cell O6 is either 0 or blank, so you would do it the same way I showed in Message #3 ... test to see if O6 equals 0.

=IF(O6=0,"",SUM(O6-S6)/O6)
 
Upvote 0
Hi,

Can we please drop the SUM:

=IF(O6=0,"",(O6-S6)/O6)

=IFERROR((O6-S6)/O6,"")
 
Upvote 0

Forum statistics

Threads
1,214,936
Messages
6,122,340
Members
449,079
Latest member
rocketslinger

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