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

  1. Identify your data range Highlight the cells you want to evaluate (e.g., A1:A10 for a column or B2:D20 for 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.
  2. Use AGGREGATE to exclude zeros Replace MIN with AGGREGATE and 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).
    The formula becomes: =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.)

  3. 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.
  4. (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:A10 with a named range (e.g., =AGGREGATE(6, 6, Sales)).
  5. 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

  1. 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.
  2. 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.
  3. Forgetting to lock cell references Omitting $ signs (e.g., A1:A10 instead of $A$1:$A$10) causes the range to shift when copied.
  4. 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.
  5. Overcomplicating with helper columns While you could create a temporary column to filter data, AGGREGATE is faster and avoids extra steps.

Tips

  1. 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.
  2. 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.)
  3. Shortcut for quick testing Press F9 to recalculate formulas instantly after editing AGGREGATE arguments.
  4. For Excel 2013 or older AGGREGATE isn’t available. Use a helper column with =IF(A1<>"", A1, ""), then apply MIN to that column.
  5. 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.
  6. Document your ranges Name your ranges (e.g., SalesData) to avoid errors when sharing files. Go to Formulas > Define Name.

Troubleshooting

If AGGREGATE returns #VALUE!:

  1. 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.
  2. 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.
  3. 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:

  1. Inspect for hidden zeros Some data may appear blank but contain a space or zero. Use =TRIM(A1) to clean cells before analysis.
  2. 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.
  3. 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:

  1. Close and reopen Excel Restart the application to clear temporary glitches.
  2. Avoid extremely large ranges AGGREGATE can struggle with ranges over 10,000 cells. Split the data or use a helper column for larger datasets.
  3. 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:

  1. Add a helper column with =IF(A1<>"", A1, "") (for non-blanks) or =IF(A1=0, A1, "") (for non-zeros).
  2. Use =MIN(helper_column).
  3. Delete the helper column after use.
AGGREGATE is cleaner for most cases.

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:

  1. Use AGGREGATE to find the minimum value.
  2. Apply conditional formatting rules to cells where values equal that minimum (e.g., highlight if =$B$1).
Example: Highlight the smallest non-zero value in column A.

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.