Help Adjusting Formula to prevent #DIV/0!

G

guilbj2

I'm using the following formula and was wondering if anyone could help
me adjust it to show nothing if there are no values to calculate
instead of #DIV/0!

=(SUMPRODUCT(B5:B11,D5:D11)+SUMPRODUCT(C5:C11,E5:E11))/SUM(B5:B11)


Any help would be appreciated, thanks !
 
R

Roger

You can put an if condition in the formula as follows:

=IF(SUM(B5:B11)=0,"",(SUMPRODUCT(B5:B11,D5:D11)+SUMPRODUCT
(C5:C11,E5:E11))/SUM(B5:B11))
 
K

Ken Wright

Just test to see if the denominator is 0 first:-

=IF(denom=0,"",Your_Formula)

=IF(SUM(B5:B11)=0,"",(SUMPRODUCT(B5:B11,D5:D11)+SUMPRODUCT(C5:C11,E5:E11))/SUM(B
5:B11))

or you can replace the "" with 0
 

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