To find the minimum value in a range while ignoring zeros, the fastest method is using the MINIFS function: =MINIFS(range, range, ">0"). This tells Excel to look at your selected cells and return the smallest number that is strictly greater than zero, effectively skipping all zeros and negative numbers. This is essential for datasets where zero represents a missing value, a placeholder, or a non-applicable entry that would otherwise skew your minimum calculation to always be zero.
What You'll Need
- Microsoft Excel (Office 365, Excel 2019, or newer for MINIFS; older versions require an array formula).
- A dataset containing numerical values, including at least one zero and one positive number.
- Basic knowledge of how to select a cell range (e.g., A1:A10).
Step-by-Step
Depending on your version of Excel, there are three primary ways to achieve this. The MINIFS method is the modern standard, while the AGGREGATE and MIN(IF) methods provide compatibility for older software or more complex criteria.
Method 1: Using MINIFS (Recommended for Modern Excel)
- Click on the cell where you want the result to appear.
- Type
=MINIFS(to start the function. - Select the range of cells you want to evaluate (e.g.,
A2:A20). This is the "min_range" where Excel will look for the smallest value. - Type a comma to move to the first criteria range. Select the same range again (
A2:A20). - Type another comma, then enter the criteria in double quotes:
">0". This explicitly tells Excel to ignore any cell that is not greater than zero. - Close the parenthesis and press Enter. The final formula should look like:
=MINIFS(A2:A20, A2:A20, ">0").
Method 2: Using AGGREGATE (Best for ignoring errors and zeros)
- Select your target cell and type
=AGGREGATE(. - Enter the number
15. This tells Excel you want to use the SMALL function. - Enter the number
6. This is a critical step that tells Excel to ignore error values within the range. - Select your range (e.g.,
A2:A20). - To exclude zeros, you must create a conditional array. Type a comma, then enter
1(meaning you want the 1st smallest value). - Because AGGREGATE handles arrays differently, for zero-exclusion specifically, it is often paired with a division trick:
=AGGREGATE(15, 6, A2:A20/(A2:A20>0), 1). - Press Enter. This formula divides the values by a TRUE/FALSE statement; zeros become division-by-zero errors, which the "6" argument then ignores.
Method 3: Using MIN and IF (For Legacy Excel Versions)
- Select your target cell and type
=MIN(IF(A2:A20>0, A2:A20)). - Crucial Step: Do not simply press Enter. Because this is an array formula, you must press
Ctrl + Shift + Enter. - Excel will automatically wrap the formula in curly brackets
{ }. If you don't see these brackets, the formula will likely return 0 or an error. - The formula evaluates every cell in the range; if the value is greater than 0, it keeps the value; otherwise, it assigns it as FALSE. The MIN function then ignores the FALSE values and finds the smallest remaining number.
Common Mistakes
One of the most frequent errors is forgetting the double quotes around the criteria in the MINIFS function. Writing =MINIFS(A2:A20, A2:A20, >0) will result in a formula error because Excel interprets the greater-than symbol as a mathematical operator rather than a text-based criterion. Always wrap your logic in quotes: ">0".
Another common mistake is using the standard =MIN(A2:A20) and assuming that if you hide the zeros using a custom number format (like 0;-0;;@), the formula will ignore them. Hiding a value from view does not remove it from the calculation. The MIN function will still see the zero and return it as the smallest value, regardless of whether the cell looks empty to the human eye.
Users often forget the Ctrl + Shift + Enter requirement for the MIN(IF) method in older versions of Excel. In modern Excel (Office 365), "Dynamic Arrays" handle this automatically, but in Excel 2016 or earlier, failing to use the keyboard shortcut results in the formula only evaluating the first cell of the range rather than the entire array.
Tips
If your dataset contains negative numbers and you only want to exclude zeros (but keep the negatives), change your criteria from ">0" to "<>0". The <> symbol represents "not equal to" in Excel. This ensures that a value of -5 is recognized as the minimum, while 0 is ignored.
To make your formulas more flexible, instead of hard-coding ">0", you can reference a cell. For example, if cell B1 contains the value 0, you can write =MINIFS(A2:A20, A2:A20, ">"&B1). This allows you to quickly change the threshold for what is considered "too small" without editing the formula itself.
For very large datasets, MINIFS is significantly more performant than array formulas. If your spreadsheet is lagging, avoid using the MIN(IF) method and switch to MINIFS or a helper column. A helper column involves creating a new column that uses an IF statement to return the value if it's non-zero and a blank if it is zero, then running a simple MIN on that helper column.
Troubleshooting
If your formula returns 0 despite using MINIFS, check your data types. Often, numbers are stored as text. If the numbers are left-aligned in the cell, Excel may be treating them as strings. To fix this, select the column, go to the Data tab, select Text to Columns, and click Finish immediately. This forces Excel to re-evaluate the cells as numbers.
If you receive a #VALUE! error, it is likely because your range contains existing error messages (like #N/A or #DIV/0!). The MINIFS function cannot ignore errors on its own. In this case, use the AGGREGATE method mentioned in Method 2, as the option 6 is specifically designed to bypass error values.
If the formula returns a very large number or an unexpected result, ensure your range is correct. If you accidentally include the cell where the formula itself is located, you may create a circular reference, which will cause the formula to fail or return 0.
Frequently Asked Questions
Can I exclude both zeros and negative numbers?
Yes, the =MINIFS(range, range, ">0") formula specifically excludes both zeros and negative numbers, as it only looks for values strictly greater than zero.
What happens if all cells in the range are zero?
If no cells meet the criteria (i.e., every single cell is 0 or empty), MINIFS will return 0. To handle this gracefully, you can wrap the formula in an IFERROR or use an IF statement to check if any values greater than zero exist first.
Does this work with empty cells?
Yes. Both MINIFS and the array methods naturally ignore truly empty cells. They only struggle with cells that contain a literal 0 or a formula that results in 0.
Is there a way to do this without formulas?
Yes, you can use the Filter feature. Filter your column to hide all zeros, then highlight the remaining visible cells. Excel will show the minimum value in the status bar at the bottom right of the window. Alternatively, you can use a Pivot Table and set a filter on the value field to exclude 0.
Will this work in Google Sheets?
Yes, Google Sheets supports the MINIFS function using the exact same syntax as Microsoft Excel.