Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default Can I turn off 0 divide error, for denominator = 0

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?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Can I turn off 0 divide error, for denominator = 0

set the default value of all denominators to one rather than zero
--
Gary''s Student - gsnu200762
  #3   Report Post  
Posted to microsoft.public.excel.misc
dlw dlw is offline
external usenet poster
 
Posts: 510
Default Can I turn off 0 divide error, for denominator = 0

Any time you divide you have to either check the denominator or trap the
error, welcome to the world of programming...

" wrote:

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?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,440
Default Can I turn off 0 divide error, for denominator = 0

But, if I tested this right, 5M checks take less than half a second.... So why bother?

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"dlw" wrote in message ...
| Any time you divide you have to either check the denominator or trap the
| error, welcome to the world of programming...
|
| " wrote:
|
| 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?
|


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
Divide by zero error jimmy Excel Discussion (Misc queries) 1 June 13th 07 02:36 AM
Running Average ? and Divide by 0 error! [email protected] Excel Worksheet Functions 3 February 1st 07 09:03 PM
Divide by zero error gregmosu Excel Discussion (Misc queries) 1 June 30th 06 05:00 PM
Sum and Divide Formula error JaB Excel Worksheet Functions 7 April 19th 06 07:47 PM
excel divide by zero error Titanium Excel Worksheet Functions 5 November 27th 05 12:15 AM


All times are GMT +1. The time now is 08:49 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"