# dividing calculation

#### bartoni

##### Active Member
HI, is there anyway anyone can help me?

Ive currently calculating 10 quarters of return on investment using quarterly sales divided by quartely promotion.

If a product has 0 sales and 0 promo, the value returned is DIV!0 not 0.

If a product does not have 10 quarters of data, both sales and promo will be blank and consequently the calculation returns a DIV!0 error.

How do i make it so that zero divided by zero will return a 0
and blank divided by blank returns a DIV!0 error.

Is the return error custonisable?

Thanks

### Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

#### mianmazher

##### Active Member

I think it will solve ur problem

Regards

Mian Mazher

##### MrExcel MVP
Care to post one of the formulas that gives you #DIV/0! ?

#### bartoni

##### Active Member
Here it is a simple division formula

=E2/N2

Ive tried the =ISNA(E2/N2) but it just says false.

Thanks

##### Well-known Member
Hello,

I don't think ISNA will work for no values, I believe you need iserror

e.g.

=IF(ISERROR(E9/F9),0,E9/F9)

Change cell refs and formula to suit.

#### mianmazher

##### Active Member
=if(isna(yourformula),yourformula,0)

hope u will understand

Regards

Mian Mazher

##### MrExcel MVP
bartoni said:
Here it is a simple division formula

=E2/N2

...

=IF(N2,E2/N2,0)

If N2 can house a rext value like "", then use:

=IF(N(N2),E2/N2,0)

Replies
1
Views
280
Replies
3
Views
506
Replies
3
Views
166
Replies
6
Views
388
Replies
4
Views
128

1,186,908
Messages
5,960,526
Members
438,482
Latest member
Iamatlulu

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