#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

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
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))))
 
Upvote 0
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.
 
Upvote 0
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?
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,222,313
Messages
6,165,285
Members
451,949
Latest member
bovacik

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