#1   Report Post  
Andy
 
Posts: n/a
Default #div/0 Error

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))
  #2   Report Post  
Duke Carey
 
Posts: n/a
Default

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)))

"Andy" wrote:

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))

  #3   Report Post  
Andy
 
Posts: n/a
Default

Duke,
Thanks for this. Unfortunately I'm getting an error that I'm missing a
parenthesis in my formula.
Andy

"Duke Carey" wrote:

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)))

"Andy" wrote:

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))

  #4   Report Post  
Duke Carey
 
Posts: n/a
Default

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))

"Andy" wrote:

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))

  #5   Report Post  
Max
 
Posts: n/a
Default

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)))
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----




  #6   Report Post  
Andy
 
Posts: n/a
Default

DUKE, YOU ROCK!!!!!!!!!

Thanks a bunch. And I actually think I get how you did it as well.

"Duke Carey" wrote:

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))

"Andy" wrote:

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))

  #7   Report Post  
Max
 
Posts: n/a
Default

Sorry, forgot to mention that both formulas should be array-entered, i.e.
press CTRL+SHIFT+ENTER (instead of just pressing ENTER)
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I prevent a #DIV/0! error from plotting on a chart CTarantino Charts and Charting in Excel 3 August 26th 05 08:35 AM
replace "#DIV/0!" error with blanks Mark B Excel Worksheet Functions 0 June 22nd 05 10:19 AM
# DIV/0! error in Excel Helpwanted Excel Discussion (Misc queries) 8 May 6th 05 09:31 PM
"Average" with error DIV/0 agenda9533 Excel Discussion (Misc queries) 1 March 2nd 05 05:47 PM
#DIV/0 Error Dominique Feteau Excel Worksheet Functions 2 December 19th 04 08:06 AM


All times are GMT +1. The time now is 12:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"