LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #19   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,059
Default Divide by the minimum non-zero number in a range of cells

"Shane Devenshire" wrote:
Or after some thought how about just
=SUMPRODUCT(MIN(2*(A1:A8=0)+A1:A8))


Perhaps you should do less "thought" and more testing. Try A1:A8 equal to
{0,3,3,3,3,3,3,0}. Klunk!

Anyway, I think the horse is dead.


----- original message -----

"Shane Devenshire" wrote in
message ...
Hi,

Or after some thought how about just

=SUMPRODUCT(MIN(2*(A1:A8=0)+A1:A8))

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"JoeU2004" wrote:

"Shane Devenshire" wrote:
=SUMPRODUCT(MIN(9^9*(A1:A8=0)+A1:A8))


Why 9^9? Why not something more straight-forward like 10^10? That can
written as the constant 1E10?

And why is this any better than Biff's (T.Valko's) formulation that uses
MIN(INDEX(...))? I presume you saw his, since you posted your follow-up
more than 4 hours later to the same news server, I believe.

In any case, as I noted regarding Biff's formula, expressions of this ilk
limit MAX(A1:A8) to whatever factor you use, be it 9^9, 1E10 or 1E100.
So
it would behoove you to use a larger factor like 1E10 or even 1E100.

And to that end, I think it would be better to replace any constant
factor
(e.g. 9^9) with 2*max(A1:A8). That limits MAX(A1:A8) to 2^1023, about
half
the biggest value allowed.

I also noted that we can extend the range of values for MAX(A1:A8) by
replacing the factor 2 with a smaller factor larger than 1; the smallest
constant factor is 1.00000000000001.

But none of this seems to be worth the trouble just to avoid the
straight-forward array formula solution, as much as I don't like array
formulas myself.


----- original message -----

"Shane Devenshire" wrote in
message ...
Well that's pretty interesting, unfortunately I cleared my test range
and
can't duplicate the original results.

Alternative:

=SUMPRODUCT(MIN(9^9*(A1:A8=0)+A1:A8))

hopefully this is a little better.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Shane Devenshire" wrote:

Hi,

If you don't want an array formula try this

=SUMPRODUCT((A1:A7<0)*(MIN(A1:A7)=A1:A7)*A1:A7)

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Opus" wrote:

I need to find the minimum non-zero number in a range of cells that
contains
some zeroes. So that I can divide by the minimum number. Any
ideas?

If I just use the MIN function, it returns a value of 0, then when
my
formula divides by that I get the divide by zero error.




 
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
Finding Minimum but if same number repeats in the range, then find MIK Excel Discussion (Misc queries) 1 January 9th 09 03:13 AM
Get a row number of range where a value is between minimum and max Tetsuya Oguma Excel Worksheet Functions 2 October 1st 08 01:00 AM
Divide a range of cells by a number Kate Excel Discussion (Misc queries) 3 May 3rd 08 06:36 PM
Return the minimum number in a range excluding zero Jive Excel Worksheet Functions 3 November 8th 07 01:41 PM
divide all numbers in range by a fixed number dhig3903 Excel Discussion (Misc queries) 2 August 9th 06 08:04 AM


All times are GMT +1. The time now is 07:02 PM.

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

About Us

"It's about Microsoft Excel"