#DIV/0! Error

paul29berks

Active Member
Joined
Mar 15, 2004
Messages
293
I have this formula:

=IF(AND($D$174=0,$Z$174=0),CG$174*($Z$169+$AP$169)/($Z$174+$AP$174),IF(AS$174=0,CG$174*($BN$169+$CD$169)/($BN$174+$CD$174),CG$174*($BN$169/$BN$174)))

However there are instances where I am dividing by 0 and receive the following error - does anyone know how I can prevent this by building into this formula?

Thanks
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Jon von der Heyden

MrExcel MVP, Moderator
Joined
Apr 6, 2004
Messages
10,884
Office Version
  1. 365
Platform
  1. Windows
Code:
=IF(ISERROR(IF(AND($D$174=0,$Z$174=0),CG$174*($Z$169+$AP$169)/($Z$174+$AP$174),IF(AS$174=0,CG$174*($BN$169+$CD$169)/($BN$174+$CD$174),CG$174*($BN$169/$BN$174)))),0,IF(AND($D$174=0,$Z$174=0),CG$174*($Z$169+$AP$169)/($Z$174+$AP$174),IF(AS$174=0,CG$174*($BN$169+$CD$169)/($BN$174+$CD$174),CG$174*($BN$169/$BN$174))))
 

WernerLouw

Board Regular
Joined
Dec 9, 2004
Messages
93
Try using the isserror function.


=IF(ISERROR((your formula here)),"",(your formula here))

it is easy if you use the ASAP utiities add-in you can get it on the recommended add-ins section.
 

paul29berks

Active Member
Joined
Mar 15, 2004
Messages
293
Sorry to be a pain have included as:

IF(ISERROR((IF(AND($D$14=0,$Z$14=0),CF$14*($Z9+$AP9)/($Z$14+$AP$14)),"",(IF(AR$14=0,CF$14*($BN9+$CD9)/($BN$14+$CD$14),CF$14*($BN9/$BN$14))

but unaccepted. Can you help?
 

Fergus

Well-known Member
Joined
Mar 10, 2004
Messages
1,174
Hi Paul,

=IF(ISERROR(IF(AND($D$14=0,$Z$14=0),CF$14*($Z9+$AP9)/($Z$14+$AP$14),IF(AR$14=0,CF$14*($BN9+$CD9)/($BN$14+$CD$14),CF$14*($BN9/$BN$14)))),"",IF(AND($D$14=0,$Z$14=0),CF$14*($Z9+$AP9)/($Z$14+$AP$14),IF(AR$14=0,CF$14*($BN9+$CD9)/($BN$14+$CD$14),CF$14*($BN9/$BN$14))))

But see also : http://www.mrexcel.com/board2/viewtopic.php?t=126320
 

Forum statistics

Threads
1,181,361
Messages
5,929,531
Members
436,676
Latest member
Mavri

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