# Dividing by zero with nested IF's

#### Scott Krause

##### Board Regular
I'm working with excel 2003, I've got one column (E) being divided by another (H). If column E is 0 I get #DIV/0!. Here's the formula I used, what can I do to have 0 entered instead of the error?

=IF(H6/E6<0.5,0,IF(H6/E6<0.67,1,IF(H6/E6<0.83,2,IF(H6/E6<1,3,IF(H6/E6<1.17,4,5)))))

Thanks again

### Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Try
=IF(E6=0, 0 , MATCH(H6/E6,{-9.9E-199,0.5,0.67,0.83,1,1,17})-1 )

Or =IF(E6="", 0, IF(E6=0,0, IF(H6/E6<0.5,0,IF(H6/E6<0.67,1,IF(H6/E6<0.83,2,IF(H6/E6<1,3,IF(H6/E6<1.17,4,5)))))))

Which probably isn't as efficient as Mikes

it entered a zero but also said it was an inconsistent formula.

Inconsistent with the formula around it?? This would be because you haven't changed them all to the new formula yet

Replies
5
Views
318
Replies
3
Views
143
Replies
3
Views
333
Replies
3
Views
264
Replies
7
Views
170

1,203,198
Messages
6,054,073
Members
444,701
Latest member
PTDykman

### 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