#div/0 Error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Like a previous post, trying to avoid the #div/0 error. I tried to get
something from the previous post, but have no ideas? Any help?

Named Ranges:
City = B1:B1000
Sold = Total Number Sold, C1:C1000
TotalInv = Total Remaining in Stock, D1:D1000

=SUM(IF(City="New York",Sold,0))/SUM(IF(City="New York",TotalInv,0))
 
Maybe..

=IF(SUM(IF(City="New York",TotalInv,0)=0,0,SUM(IF(City="New
York",Sold,0))/SUM(IF(City="New York",TotalInv,0)))
 
Duke,
Thanks for this. Unfortunately I'm getting an error that I'm missing a
parenthesis in my formula.
Andy
 
Perhaps should have read your question a little more closely

How about

=IF(SUMIF(City,"New York",TotalInv)=0,0,SUMIF(City,"New
York",Sold)/SUMIF(City,"New York",TotalInv))
 
Try this amended version of Duke's suggestion:

=IF(SUM(IF(City="New York",TotalInv,0))=0,0,SUM(IF(City="New
York",Sold,0))/SUM(IF(City="New York",TotalInv,0)))

Alternatively, perhaps a slightly shorter version
which returns blank: "" instead of zero:

=IF(SUM(IF(City="New York",TotalInv))=0,"",SUM(IF(City="New
York",Sold))/SUM(IF(City="New York",TotalInv)))
 
DUKE, YOU ROCK!!!!!!!!!

Thanks a bunch. And I actually think I get how you did it as well.
 
Sorry, forgot to mention that both formulas should be array-entered, i.e.
press CTRL+SHIFT+ENTER (instead of just pressing ENTER)
 

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

Similar Threads


Back
Top