To exclude zeros (and blank cells) when using the MIN function in Excel, wrap the range in the AGGREGATE function with a specific array constant. This avoids false low values from accidental zeros or empty cells, ensuring MIN returns the true minimum of valid numbers. For example, if your range contains [10, 0, 5, 0, ""], MIN would return 0, but AGGREGATE(6, 6, range) skips zeros, returning 5.
What You'll Need
- Excel (Windows or Mac)
- A worksheet with numeric data that may include zeros or blanks
- Basic familiarity with Excel functions (MIN, AGGREGATE)
- (Optional) Keyboard shortcuts for speed: Ctrl+; for MIN and Shift+; on Mac
Step-by-Step
- Identify your data range
Highlight the cells you want to evaluate (e.g.,
A1:A10for a column orB2:D20for a block). Zeros or blanks in this range will normally be considered by MIN. Use=MIN(A1:A10)as a test to confirm the issue—it likely returns a zero or blank. - Use AGGREGATE to exclude zeros
Replace MIN with
AGGREGATEand set two arguments:- Mode 6 (ignores hidden rows/columns) – change to mode 4 if you also want to skip errors like #N/A.
- Function type 6 (MIN).
=AGGREGATE(6, 6, A1:A10)For example, in
B1, enter:=AGGREGATE(6, 6, $A$1:$A$10)(The$signs lock the range for easy copying down.) - Verify the result
Press Enter. The cell should now return the smallest non-zero number in your range. Compare it to
=MIN(A1:A10)—the original will still include zeros, while AGGREGATE skips them. - (Optional) Adapt for other scenarios
- Skip blanks and zeros: Use
AGGREGATE(6, 6, range)(default behavior). - Skip errors and zeros: Use
AGGREGATE(4, 6, range)(mode 4 ignores errors). - Dynamic ranges: Replace
A1:A10with a named range (e.g.,=AGGREGATE(6, 6, Sales)).
- Skip blanks and zeros: Use
- Apply to entire columns
Drag the formula down or across to replicate it. Use
Ctrl+D (Windows) or Cmd+D (Mac) to copy the formula down a column.
Common Mistakes
- Using MIN without AGGREGATE Excel’s native MIN function treats zeros and blanks as valid values. Always test with a range containing zeros to confirm the issue.
- Incorrect AGGREGATE arguments Mixing up modes (e.g., using 1 for SUM instead of 6 for MIN) or function types (e.g., 3 for MAX) will break the calculation. Double-check the numbers in parentheses.
- Forgetting to lock cell references
Omitting
$signs (e.g.,A1:A10instead of$A$1:$A$10) causes the range to shift when copied. - Assuming blanks are ignored by default
MIN doesn’t skip blanks—it treats them as
0. Test with=MIN(A1:A10)on a range containing empty cells to see the error. - Overcomplicating with helper columns While you could create a temporary column to filter data, AGGREGATE is faster and avoids extra steps.
Tips
- Combine with IFERROR for robustness
Wrap AGGREGATE in IFERROR to handle cases where all cells are zero or blank:
=IFERROR(AGGREGATE(6, 6, A1:A10), "No valid data")This returns a message instead of an error. - Use with LARGE for top-N exclusion
To find the 3rd smallest number excluding zeros:
=LARGE(AGGREGATE(6, 6, A1:A10), 3)(Note: LARGE must process the array first; wrap AGGREGATE in an array formula or use a helper column if needed.) - Shortcut for quick testing Press F9 to recalculate formulas instantly after editing AGGREGATE arguments.
- For Excel 2013 or older
AGGREGATE isn’t available. Use a helper column with
=IF(A1<>"", A1, ""), then apply MIN to that column. - Check for hidden rows
AGGREGATE’s mode 6 ignores hidden rows. If your data is filtered or hidden, use
AGGREGATE(6, 6, range)to include all cells. - Document your ranges
Name your ranges (e.g.,
SalesData) to avoid errors when sharing files. Go toFormulas > Define Name.
Troubleshooting
If AGGREGATE returns #VALUE!:
- Check your arguments
Ensure you’re using mode 6 (or 4) and function type 6. Example:
AGGREGATE(6, 6, A1:A10)is correct;AGGREGATE(6, 4, A1:A10)(function type 4 = COUNT) is wrong. - Verify your data range Copy-paste the range into a new sheet to confirm it contains numbers. If the range is empty or non-numeric, AGGREGATE will fail.
- Test with a simple example
Try
=AGGREGATE(6, 6, 1, 0, 5). It should return 1. If this fails, there’s a system issue (restart Excel).
If the result is still incorrect:
- Inspect for hidden zeros
Some data may appear blank but contain a space or zero. Use
=TRIM(A1)to clean cells before analysis. - Check for errors in the range
If your data includes #N/A or other errors, use mode 4 instead of 6:
=AGGREGATE(4, 6, A1:A10)This skips both zeros and errors. - Re-evaluate your data source If the range references another sheet or workbook, ensure the link is active. Broken links cause AGGREGATE to fail.
If Excel crashes or freezes:
- Close and reopen Excel Restart the application to clear temporary glitches.
- Avoid extremely large ranges AGGREGATE can struggle with ranges over 10,000 cells. Split the data or use a helper column for larger datasets.
- Update Excel
Older versions (<2010) lack AGGREGATE. Upgrade via
File > Account > Update Options.
Frequently Asked Questions
Why does MIN return 0 when there are valid numbers?
MIN treats zeros and blanks as valid values. For example, in [10, 0, 5], it returns 0 because that’s the smallest value. Use AGGREGATE(6, 6, range) to exclude zeros.
Can I exclude non-zero numbers and only find the minimum of zeros?
No. AGGREGATE cannot filter for zeros specifically—it only excludes them from the calculation. To find the minimum of zeros, use =MINIFS(range, range, 0) (Excel 2019+), or a helper column with =IF(range=0, range, "").
Will AGGREGATE work with filtered data?
By default, AGGREGATE ignores hidden rows (mode 6). To include filtered rows, use =AGGREGATE(6, 6, range) without any special mode. For unfiltered data, mode 6 is safe.
Is there a way to do this without AGGREGATE?
Yes, for older Excel versions or large datasets:
- Add a helper column with
=IF(A1<>"", A1, "")(for non-blanks) or=IF(A1=0, A1, "")(for non-zeros). - Use
=MIN(helper_column). - Delete the helper column after use.
Does this work with negative numbers?
Yes. AGGREGATE treats negative numbers normally. For example, in [10, -5, 0, -10], =AGGREGATE(6, 6, range) returns -10, the true minimum.
Can I use this with conditional formatting?
Yes, but indirectly. AGGREGATE can’t apply styles, but you can:
- Use AGGREGATE to find the minimum value.
- Apply conditional formatting rules to cells where values equal that minimum (e.g., highlight if
=$B$1).
What if all cells are blank or zero?
AGGREGATE will return an empty string or error. Wrap it in IFERROR to handle this:
=IFERROR(AGGREGATE(6, 6, A1:A10), "No data")
This returns a custom message instead of #N/A.