Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Returning the Smallest Non-Zero Value.

# Returning the Smallest Non-Zero Value

by Allen Wyatt
(last updated August 31, 2018)

Mark is hoping to find the smallest non-zero value in a set of values. For example, if he has the values 0,0,3,0,6,8, he would want the value 3 (the smallest non-zero value) returned by a formula. Mark knows he can use the SMALL function with the second argument calculated by using a COUNTIF to count the number of zeroes in the range. However, he wants to use this inside of an array formula, and Excel can't handle COUNTIFs inside of array formulas.

Since Mark is only interested in array formulas (entered by pressing Ctrl+Shift+Enter), then there are a couple that could be used. The following array formula is worth looking at first:

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

Assuming the values to be examined are in A1:A5, this formula puts together an array of non-zero values from that range. If the value in one of the cells is 0, then the MAX function kicks in, returning the largest value from the range. (This essentially kicks the value at that cell—originally 0—out of consideration as the smallest value.) If the value in one of the cells is not 0, then the actual value is returned. The MIN function then returns the lowest value from the array.

You can make the formula even shorter by turning it around in this manner:

```=MIN(IF(A1:A5<>0,A1:A5))
```

Note that in this version, the value in each cell of the range is checked to see if it isn't 0. If it isn't, then the value is returned. If it is 0, then nothing is returned. Again, the MIN function is used to return the lowest value from the array.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (3260) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Returning the Smallest Non-Zero Value.

##### Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

##### MORE FROM ALLEN

Maintaining Delivery Address Information for Envelopes

Using the Envelopes and Labels dialog box to print envelopes is quick and easy. It can also be frustrating, however, ...

Discover More

Setting the Left Indent of a Paragraph in a Macro

When using a macro to format text, you can set all sorts of attributes for paragraphs or individual characters. On ...

Discover More

Specifying the Behavior of the Enter Key

When you press Enter while adding information to a worksheet, Excel normally drops to the next cell down in the column. ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

Determining a Name for a Week Number

You could use Excel to collect data that is useful in your business. For instance, you might use it to collect ...

Discover More

Incrementing References by Multiples when Copying Formulas

You can easily set up a formula to perform some calculation on a range of cells. When you copy that formula, the copied ...

Discover More

Compiling a List of Students in a Course

Need to pull just a limited amount of information from a large list? Here are a few approaches you might be able to use ...

Discover More
##### Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is one minus 0?

2019-03-26 04:25:17

Memo Ali

excel find minimum value greater than 0
i'm Using formula like that to Find the minimum Value Greater Than Zero it's a table
so i have two Formulas
1- to find the day that belong to the Minimum Value
=INDEX(Table[Date];MATCH(MIN(IF((Table[Date]<=\$B\$3)*(Table[Date]>=\$D\$3);Table[Total];0));Table[Total];0))

2- To Find the Minimum Value
=MIN(IF((Table[Date]<=\$B\$3)*(Table[Date]>=\$D\$3);Table[Total];0))

So what should i do to fine Minimum Value Greater than 0

2016-04-29 11:53:05

Altaf

hey Michael (Micky) Avidan

You r a rockstart, the solution given to Frank wonders for me, i was scratching my head since last 2 days on this. u reply did the job.

Thanks a lot,

Altaf

2016-03-25 12:11:31

richard widman

Returning the Smallest Non-Zero Value

what if the numbers are not in contiguous columns?
ie: lowest non zero in column L where values are in columns D, I, K, and I or K could be zero?

2015-06-03 07:16:12

Michael (Micky) Avidan

@Anurag,

=MAX(A3*B3,21)

Michael (Micky) Avidan
“Microsoft® Answers" - Wiki author & Forums Moderator
“Microsoft®” MVP – Excel (2009-2015)
ISRAEL

2015-06-03 07:13:59

Michael (Micky) Avidan

@Anurag,
I do hope that the my following suggestion (in the pictured link) is what you have in mind:

http://jpg.co.il/view/556ee0dc64db8.png/

Michael (Micky) Avidan
“Microsoft® Answers" - Wiki author & Forums Moderator
“Microsoft®” MVP – Excel (2009-2015)
ISRAEL

2015-06-03 03:38:10

Anurag

I want to calculate suppose for Rs. 5000 brokerage 0.40 paise so if the brokerage is less than 21 value should be 21 or if the amount is greater than 21 then it should apply maximum.

What formula do i need to put in excel to get that

2015-04-07 07:02:16

RASAKUMAR

I TRIED THE ABOVE FORMULA. THE RESULT I GOT IN THE CELL WAS "#VALUE!".

2015-03-20 06:21:31

Michael (Micky) Avidan

@gina,
"...if it is greater than zero, then I only want zero".
To me it sounds like a paradox ?Michael
Please try again and it could be nice if you'll present "your" 5 values for which you need the Minimum.
(Micky) Avidan
“Microsoft® Answers" - Wiki author & Forums Moderator
“Microsoft®” MVP – Excel (2009-2015)
ISRAEL

2015-03-19 12:45:36

gina

Thank you, There are both positive and negative values in the range. if I enter =min(A1:A5)then I get the smallest number. I am looking for the max number, but if it is greater than zero, then I only want zero.

2015-03-19 12:39:28

gina

I am looking for the max number of 4 numbers, but if greater than zero, I want to return zero.

2015-03-04 15:45:33

Michael (Micky) Avidan

@Frank,
Try: =SMALL((A1,C1,AT1,BB1,CI1),1+FREQUENCY((A1,C1,AT1,BB1,CI1),0))
-------------------------------------------------------
Michael (Micky) Avidan
“Microsoft® Answers" - Wiki author & Forums Moderator
“Microsoft®” MVP – Excel (2009-2015)
ISRAEL

2015-03-03 17:27:10

Frank Tralli

Hello- Im simply trying to get the lowest non-zero \$ value amongst a group of cells but not a range like above. When I substitute the group of cells for the range, formula doesn't work. Can you pls advise?

Group example - A1,C1,AT1,BB1,CI14 etc.

Thank you,
Frank

2014-09-03 09:26:31

Michael (Micky) Avidan

1) If the range will have a negative value then the following formula will do:
=MIN(A1:A5)
2) If only Positive values in the range - then there is no need to run an IF check:
=MIN((A1:A5<>0)*A1:A5)
Michael (Micky) Avidan
“Microsoft® Answers" - Wiki author & Forums Moderator
“Microsoft®” MVP – Excel (2009-2015)
ISRAEL

##### This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

##### Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."