Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / General Excel Questions / December 2007

Tip: Looking for answers? Try searching our database.

Can I turn off 0 divide error, for denominator = 0

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ato_zee@hotmail.com - 29 Dec 2007 15:00 GMT
I have a macro with many divisions, for many
of the divisions both the numerator and denominator are zero.
It's the no data case, so it's 0/0 for that condition
(or else it's a fraction).
Office 2007, integer dimensioned values.
If denominator = 0 then denominator = 1
will get round it since it's then 0/1 and still equates
to 0.
But doing this comparison a million or so
times is clearly time consuming and inefficient.
With the current database, and growing, it's approx
5M divide by 0 tests.
Any suggestions?
Gary''s Student - 29 Dec 2007 15:10 GMT
set the default value of all denominators to one rather than zero
Signature

Gary''s Student - gsnu200762

dlw - 29 Dec 2007 18:20 GMT
Any time you divide you have to either check the denominator or trap the
error, welcome to the world of programming...

> I have a macro with many divisions, for many
> of the divisions both the numerator and denominator are zero.
[quoted text clipped - 9 lines]
> 5M divide by 0 tests.
> Any suggestions?
Niek Otten - 29 Dec 2007 22:05 GMT
But, if I tested this right, 5M checks take less than half a second.... So why bother?

Signature

Kind regards,

Niek Otten
Microsoft MVP - Excel

| Any time you divide you have to either check the denominator or trap the
| error, welcome to the world of programming...
[quoted text clipped - 12 lines]
| > 5M divide by 0 tests.
| > Any suggestions?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.