#DIV/0! error

C

Curtis

I am using the formula
=(SUMIF('Tech Ops Data Base 2007.xls'!TechallDate,C$36&$A37,'Tech Ops Data
Base 2007.xls'!sales))/SUMIF('Tech Ops Data Base
2007.xls'!TechallDate,C$36&$A37,'Tech Ops Data Base 2007.xls'!salesWO)

However in some causes I am receiving the following error #DIV/0!. Is there
anything I can do to the above formula to remove that error

thanks
 
P

Pete_UK

You could do it this way:

=IF(SUMIF('Tech Ops Data Base 2007.xls'!TechallDate,C$36&$A37,'Tech
Ops Data Base 2007.xls'!salesWO)=0,"",SUMIF('Tech Ops Data Base
2007.xls'!TechallDate,C$36&$A37,'Tech Ops Data Base 2007.xls'!sales)/
SUMIF('Tech Ops Data Base 2007.xls'!TechallDate,C$36&$A37,'Tech Ops
Data Base 2007.xls'!salesWO)

i.e. if the denominator is zero then return a blank, otherwise do the
calculation. You can change the "" in the middle to 0 if you wish.

Another way would be to use:

=IF(ISERROR(your_formula),"",your_formula)

though this would trap all errors.

Hope this helps.

Pete
 
P

Pranav Vaidya

Hi Curtis,

Change your formula as
=IF(SUMIF('Tech Ops Data Base 2007.xls'!TechallDate,C$36&$A37,'Tech Ops Data
Base 2007.xls'!salesWO)=0,0,=(SUMIF('Tech Ops Data Base
2007.xls'!TechallDate,C$36&$A37,'Tech Ops Data Base
2007.xls'!sales))/SUMIF('Tech Ops Data Base
2007.xls'!TechallDate,C$36&$A37,'Tech Ops Data Base 2007.xls'!salesWO))

Basically I am checking if the later formula is resulting in zero before
using it in the division.
HTH,
 
C

Curtis

Thanks

Is there a way to exclude cells with the #DIV/0! error when using the sum
function

example =SUM(C41:H41)
 
P

Pranav Vaidya

if you use 0 instead of "" in the IF(), the automatically there will be no
cells with #DIV/0.

HTH,
 
C

Curtis

Thanks

Pranav Vaidya said:
Hi Curtis,

Change your formula as
=IF(SUMIF('Tech Ops Data Base 2007.xls'!TechallDate,C$36&$A37,'Tech Ops Data
Base 2007.xls'!salesWO)=0,0,=(SUMIF('Tech Ops Data Base
2007.xls'!TechallDate,C$36&$A37,'Tech Ops Data Base
2007.xls'!sales))/SUMIF('Tech Ops Data Base
2007.xls'!TechallDate,C$36&$A37,'Tech Ops Data Base 2007.xls'!salesWO))

Basically I am checking if the later formula is resulting in zero before
using it in the division.
HTH,
--
Pranav Vaidya
VBA Developer
PN, MH-India
If you think my answer is useful, please rate this post as an ANSWER!!
 
P

Pete_UK

If you use the formula I gave you to return either "" or 0, then this
will not have any effect on the SUM formula, so they will be ignored.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top