#DIV/0! and sum function

mimmo_gsr

New Member
Joined
Nov 18, 2004
Messages
27
Hi all,

I have a spreadsheet with some #DIV/0! on it due to some numbers being 0/0. The 0/0 is correct, but how can I get excel to return a zero answer instead of the #DIV/0!, as when I go to sum up all the number it gives a final answer of #DIV/0!.

I have done a bit of a search to for past questions like this and one used an ISERROR function to try and resolve the issue.

My formula that I am using that returns the #DIV/0! error is as follows

=IF(G11/H11>=1.05,180,IF(G11/H11>=1,140,IF(G11/H11>=0.9,100,0)))

When G11 and H11 = zero it causes a problem.

Is there anyway to modify that formula to return a zero value instead of a #DIV/0! error value?

Or is it possible to modify the sum function to ignor the #DIV/0! or class it as a zero? It is just the sum of a range, ie =SUM(M1:M30)

Any thoughts?

Thanks

Mimmo
 

Some videos you may like

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

masim

Board Regular
Joined
Jun 19, 2003
Messages
130
like this ????

=IF(ISERROR(IF(G11/H11>=1.05,180,IF(G11/H11>=1,140,IF(G11/H11>=0.9,100,0)))),0,(IF(G11/H11>=1.05,180,IF(G11/H11>=1,140,IF(G11/H11>=0.9,100,0)))))

Regards
Asim
 

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,958
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Try this:

Code:
=IF(H11=0,0,LOOKUP(G11/H11,{-9.99999999999999E+307,0;0.9,100;1,140;1.05,180}))
 

mimmo_gsr

New Member
Joined
Nov 18, 2004
Messages
27
Hi Asim and Hotpepper,

Thanks for your help.

I ended up using =IF(h11<>0,IF(G11/H11>=1.05,180,IF(G11/H11>=1,140,IF(G11/H11>=0.9,100,0))),0)

It has fixed my problem :)

Regards

Mimmo
 

Watch MrExcel Video

Forum statistics

Threads
1,123,125
Messages
5,599,850
Members
414,342
Latest member
K Darrell Smith

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