Do not display "#DIV/0!", default to 0?

VBA_Newbie

Active Member
Joined
Jan 7, 2005
Messages
258
Hi folks,

Instead of showing "#DIV/0!" when a formula has as the denominator a 0, to just show 0 instead in the cell? All other cells where the formula does not divide by 0 should simply display normally. Is it possible?

Many thanks!
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

lu_argenitna

Board Regular
Joined
Apr 4, 2006
Messages
106
or you can also use

=if(iserror(a1/b1;0;a1/b1))
this formula cna be use to combine any other formula that can show you an error (n/a, valor!, etc) Is very useful!!
 

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
or you can also use

=if(iserror(a1/b1;0;a1/b1))
this formula cna be use to combine any other formula that can show you an error (n/a, valor!, etc) Is very useful!!

Just a note that it can be potentially negative as it traps all errors and can lead you to assume that formulas are working properly when they're not.

It also forces 2x calculation, so for longer formulas it can start getting pretty expensive.

Smitty
 

Forum statistics

Threads
1,141,096
Messages
5,704,312
Members
421,338
Latest member
Pepess

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
Top