I need to find minimum number from list of numbers, excluding zero(s).
Is there some internal function that would do that? Or do I have to remove zero(s) from list before Math.min
is used?
Example:
Input: 213
, 0
, 32
, 92
, 0
, 2992
, 39
Result: 32
[UPDATE] If possible, please provide code for function that would take inputs as arguments, such as nonZeroMin(213, 0, 32, 92, 0, 2992, 39)
Find minimum value excluding zero with formula Please apply the following formula to get the minimum value in that range excluding zero in Excel. 1. Select a blank cell (H1) for placing the minimum value, enter formula =SMALL(A1:E7,COUNTIF($A$1:$E$7,0)+1) into the Formula Bar, and then press the Enter key.
How about this?
var arry = [213, 0, 32, 92, 0, 2992, 39];
Math.min.apply(Math, arry.filter(Number)); // => 32
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With