# #DIV/0! Error

#### paul29berks

##### Active Member
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
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
Try using the isserror function.

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

#### paul29berks

##### Active Member
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
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))))

Replies
5
Views
362
Replies
0
Views
149
Replies
14
Views
499
Replies
3
Views
392
Replies
3
Views
360

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.

### Which adblocker are you using?

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

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