Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Minimum of all values > 0

Minimum of all values > 0

Minimum of all values > 0

I have a range of values.  Some are 0 and the rest are > 0.  I want the minimum of all the values > 0 using only one cell for the cell math.  How?

Good luck,

RE: Minimum of all values > 0

Assuming your range is D3:E35, use the formula
but enter it as an "array formula".

Depending on the range of values you anticipate and how they have been generated, you may want to fine-tune this by:
(a) using some other default "large" value than 9999999;
(b) changing the "=0" test to "<0.001" or some other default "small" value.

Array formulæ are entered by holding down the <Ctrl> and <Shift> keys when you hit the <Enter> key.  They will then display enclosed in {braces}.

I'm sure other posters will be making other, equally valid suggestions.  Even if you end up going with some other approach, it is worth investing time coming to grips with the potential of array formulæ.

RE: Minimum of all values > 0

You could also use VBA:


Private Sub Worksheet_Calculate()
temp = 10000000
For a = 1 To 40
current = Cells(a, 1)
If current > 0 Then
temp = IIf(temp < current, temp, current)
End If
Cells(3, 4).Value = temp
End Sub
This assumes your test values are in A1:A40 and puts the result in D3

Good Luck
To get the best from these forums read FAQ731-376 before posting

Steam Engine enthusiasts: www.essexsteam.co.uk

RE: Minimum of all values > 0

Arrays are slick!

Looks like
=MIN(IF((C4:C14)>0,(C4:C14),"")) [Ctrl-Shift-Enter]
works too.

Good luck,

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close