Minimum non-zero value

D

Derrick

I need to find the minimum non-zero value in a row of numbers - not
necessarily together
ie:
36, 0, 0, 24
i would like the resultant value to be 24
if there is a blank -
36, 0, 0, -
i would like it to be 36

any help?
 
C

Chip Pearson

You can use the following array formula. It assume that your values
are in the range A1:A5. Change this to your actual range.

=MIN(IF(A1:A5>0,A1:A5,MAX(0,MAX(A1:A5))))

Since this is an Array Formula, you *must* press CTRL SHIFT ENTER
rather than just ENTER when you first enter the formula
and whenever you edit it later. If you do this properly,
Excel will display the formula in the Formula Bar enclosed
in curly braces { }. (You do not type the curly braces -
Excel includes them automatically.) The formula will
not work properly if you do not use CTRL SHIFT ENTER. See
http://www.cpearson.com/excel/ArrayFormulas.aspx for lots
more information about array formulas.

If the values in A1:A5 are any of (1) all empty, (2) all non-numeric,
or (3) all negative, the formula returns 0.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
 
T

T. Valko

Are there any negative numbers in the range?

Try one of these:

=SMALL(A1:J1,COUNTIF(A1:J1,0)+1)

This one is an array formula** :

=MIN(IF(A1:J1>0,A1:J1))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.
 
D

Don Guillett

This is an ARRAY formula that must be entered using ctrl+shift+enter
=MIN(IF(H2:K2>0,H2:K2))
 

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

Top