MINIF function

K

kittronald

Is it possible to create a MINIF UDF ?

I'm trying to create a UDF that finds the smallest number in a range
for a given criteria.

=MINIF(range_or_array_constant,criteria)

For example, =MINIF({0,1,2,3},">0") would return 1.

Any ideas ?


- Ronald K.
 
J

Javed

Pls find the following (The use is linke SUMIF function)

Function MINIF(MyRange As Range, Criteria As String)

'The following line must be on single line
MINIF = Application.Evaluate("=MIN(IF(" & MyRange.Address & Criteria &
"," & MyRange.Address & "))")


End Function
 
K

kittronald

Javed,

Thanks for the quick reply.

Is it possible to get this to work with an array constant in
addition to a range reference ?

For example, =MINIF({0,1,2,3},0)


- Ronald K.
 
J

Javed

I am sorry.I Think it is beyond my knowledge.

I susupect it is beyond VBA.Shall be very eager to know if anyway is
there.
 

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