PC Review


Reply
Thread Tools Rate Thread

Avoid #div/0!

 
 
Harsh Bahal
Guest
Posts: n/a
 
      6th Mar 2009
Hi !

I want enter a sumproduct formula involving three ranges. However if any of
the range does not have a value the formula returns a #div/0! value. I want
to avoid that. Pl help.

 
Reply With Quote
 
 
 
 
Mike H
Guest
Posts: n/a
 
      6th Mar 2009
Post your sumproduct formula and a description of what your doing

Mike

"Harsh Bahal" wrote:

> Hi !
>
> I want enter a sumproduct formula involving three ranges. However if any of
> the range does not have a value the formula returns a #div/0! value. I want
> to avoid that. Pl help.
>

 
Reply With Quote
 
Harsh Bahal
Guest
Posts: n/a
 
      6th Mar 2009
Suppose col A1 to A5 is rate, Col B1 to B5 is cases and col C1 to C5 case
weight.In cell C6 i have entered a formula
=(SUMPRODUCT(B1:B5,A1:A5)/(SUMPRODUCT(A1:A5,$C1:$C5)))

to get the per kilogram ( or pound) rate. Which does give the correct
answer, but if there are no figures entered in col A,B or C then the formula
returns #div/0!, which is i want avoid. I am working on 100 rows like this.

"Mike H" wrote:

> Post your sumproduct formula and a description of what your doing
>
> Mike
>
> "Harsh Bahal" wrote:
>
> > Hi !
> >
> > I want enter a sumproduct formula involving three ranges. However if any of
> > the range does not have a value the formula returns a #div/0! value. I want
> > to avoid that. Pl help.
> >

 
Reply With Quote
 
Mike H
Guest
Posts: n/a
 
      6th Mar 2009
Hi,

You could do this

=IF(ISERROR(SUMPRODUCT(B1:B5,A1:A5)/(SUMPRODUCT(A1:A5,$C1:$C5))),"Incomplete
Data",SUMPRODUCT(B1:B5,A1:A5)/(SUMPRODUCT(A1:A5,$C1:$C5)))

Mike

"Harsh Bahal" wrote:

> Suppose col A1 to A5 is rate, Col B1 to B5 is cases and col C1 to C5 case
> weight.In cell C6 i have entered a formula
> =(SUMPRODUCT(B1:B5,A1:A5)/(SUMPRODUCT(A1:A5,$C1:$C5)))
>
> to get the per kilogram ( or pound) rate. Which does give the correct
> answer, but if there are no figures entered in col A,B or C then the formula
> returns #div/0!, which is i want avoid. I am working on 100 rows like this.
>
> "Mike H" wrote:
>
> > Post your sumproduct formula and a description of what your doing
> >
> > Mike
> >
> > "Harsh Bahal" wrote:
> >
> > > Hi !
> > >
> > > I want enter a sumproduct formula involving three ranges. However if any of
> > > the range does not have a value the formula returns a #div/0! value. I want
> > > to avoid that. Pl help.
> > >

 
Reply With Quote
 
Harsh Bahal
Guest
Posts: n/a
 
      6th Mar 2009
Yes it did work Thanks a ton.
I forgot to mention that this formula is again multiplied by a constant
(cell reference), which I have done.


"Mike H" wrote:

> Hi,
>
> You could do this
>
> =IF(ISERROR(SUMPRODUCT(B1:B5,A1:A5)/(SUMPRODUCT(A1:A5,$C1:$C5))),"Incomplete
> Data",SUMPRODUCT(B1:B5,A1:A5)/(SUMPRODUCT(A1:A5,$C1:$C5)))
>
> Mike
>
> "Harsh Bahal" wrote:
>
> > Suppose col A1 to A5 is rate, Col B1 to B5 is cases and col C1 to C5 case
> > weight.In cell C6 i have entered a formula
> > =(SUMPRODUCT(B1:B5,A1:A5)/(SUMPRODUCT(A1:A5,$C1:$C5)))
> >
> > to get the per kilogram ( or pound) rate. Which does give the correct
> > answer, but if there are no figures entered in col A,B or C then the formula
> > returns #div/0!, which is i want avoid. I am working on 100 rows like this.
> >
> > "Mike H" wrote:
> >
> > > Post your sumproduct formula and a description of what your doing
> > >
> > > Mike
> > >
> > > "Harsh Bahal" wrote:
> > >
> > > > Hi !
> > > >
> > > > I want enter a sumproduct formula involving three ranges. However if any of
> > > > the range does not have a value the formula returns a #div/0! value. I want
> > > > to avoid that. Pl help.
> > > >

 
Reply With Quote
 
T. Valko
Guest
Posts: n/a
 
      6th Mar 2009
>=(SUMPRODUCT(B1:B5,A1:A5)/(SUMPRODUCT(A1:A5,$C1:$C5)))

If you get a #DIV/0! error it's because this portion evaluates to 0:

SUMPRODUCT(A1:A5,$C1:$C5)

Try this:

=IF(SUMPRODUCT(A1:A5,$C1:$C5),SUMPRODUCT(B1:B5,A1:A5)/(SUMPRODUCT(A1:A5,$C1:$C5),"")

--
Biff
Microsoft Excel MVP


"Harsh Bahal" <(E-Mail Removed)> wrote in message
news:1B12B509-4A3C-4B77-A6A3-(E-Mail Removed)...
> Suppose col A1 to A5 is rate, Col B1 to B5 is cases and col C1 to C5 case
> weight.In cell C6 i have entered a formula
> =(SUMPRODUCT(B1:B5,A1:A5)/(SUMPRODUCT(A1:A5,$C1:$C5)))
>
> to get the per kilogram ( or pound) rate. Which does give the correct
> answer, but if there are no figures entered in col A,B or C then the
> formula
> returns #div/0!, which is i want avoid. I am working on 100 rows like
> this.
>
> "Mike H" wrote:
>
>> Post your sumproduct formula and a description of what your doing
>>
>> Mike
>>
>> "Harsh Bahal" wrote:
>>
>> > Hi !
>> >
>> > I want enter a sumproduct formula involving three ranges. However if
>> > any of
>> > the range does not have a value the formula returns a #div/0! value. I
>> > want
>> > to avoid that. Pl help.
>> >



 
Reply With Quote
 
Aladin Akyurek
Guest
Posts: n/a
 
      10th Mar 2009
=LOOKUP(9.99999999999999E+307,CHOOSE({1,2},0,SUMPRODUCT(B1:B5,A1:A5)/SUMPRODUCT(A1:A5,$C1:$C5)))

Harsh Bahal wrote:
> Suppose col A1 to A5 is rate, Col B1 to B5 is cases and col C1 to C5 case
> weight.In cell C6 i have entered a formula
> =(SUMPRODUCT(B1:B5,A1:A5)/(SUMPRODUCT(A1:A5,$C1:$C5)))
>
> to get the per kilogram ( or pound) rate. Which does give the correct
> answer, but if there are no figures entered in col A,B or C then the formula
> returns #div/0!, which is i want avoid. I am working on 100 rows like this.
>
> "Mike H" wrote:
>
>> Post your sumproduct formula and a description of what your doing
>>
>> Mike
>>
>> "Harsh Bahal" wrote:
>>
>>> Hi !
>>>
>>> I want enter a sumproduct formula involving three ranges. However if any of
>>> the range does not have a value the formula returns a #div/0! value. I want
>>> to avoid that. Pl help.
>>>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to avoid Compatibility Checker MsgBox? VBA to avoid or prevent? EagleOne@discussions.microsoft.com Microsoft Excel Programming 1 16th Jan 2009 08:54 PM
How to get the Big Red X (and how to avoid it) =?Utf-8?B?UnJyb2NrIEw=?= Microsoft Powerpoint 3 11th Jun 2007 04:58 AM
Avoid having a SQL express for web parts and avoid personalization Roger23 Microsoft ASP .NET 2 12th Oct 2006 11:54 PM
How to avoid??? Natka Windows XP General 2 12th Aug 2004 08:48 PM
How to avoid pop-ups erik.petersen@vcegroup.com Windows XP Internet Explorer 4 11th Dec 2003 09:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:35 PM.