Function Problems

How to Return a Blank Instead of Zero with the MAX Function

Maira MehtabMaira Mehtab Nov 10, 2026 869 views

Question details

The user wants the MAX function to return an empty string (blank) rather than a zero when the specified cell range contains no numeric data.

How to Return a Blank Instead of Zero When MAX Finds No Values
Product
Spreadsheets
Device & OS
not provided
Scenario
Calculating the maximum value in a specific range where the range might occasionally be completely empty of numbers.
Observed behavior
The standard MAX function defaults to returning 0 when it evaluates a range with no numeric values, which can clutter the spreadsheet or misrepresent data.
Before you start

Ensure that the cell range you are evaluating does not contain actual zero values that you want to keep, as this method distinguishes between empty cells and cells containing the number zero.

Solution 1Recommended

Use the IF and COUNT Functions to Check for Numbers

This is the most reliable method. The COUNT function checks if there are any numbers in the range before the MAX function is executed.

By nesting the MAX function inside an IF statement alongside the COUNT function, you can force the spreadsheet to verify the presence of numeric data first. If COUNT finds numbers, MAX calculates the highest value. If not, it outputs a blank.

1
Select the target cell

Click on the cell where you want the maximum value to appear.

2
Input the IF and COUNT formula

Type the formula =IF(COUNT(K106:O110), MAX(K106:O110), ""), replacing K106:O110 with your actual data range.

3
Apply the formula

Press Enter to apply the formula. If the range has numbers, the maximum is shown; if not, the cell remains blank.

Use the IF and COUNT Functions to Check for Numbers
Why this works: The COUNT function only counts cells with numbers. If the count is greater than 0, the IF statement evaluates to TRUE and runs the MAX function. Otherwise, it returns an empty string ("").
Advanced Spreadsheet Functions

Master Complex Formulas with WPS Spreadsheet

WPS Spreadsheet provides full support for advanced logical and statistical functions like IF, COUNT, and MAX. It is a powerful, free tool that handles complex data analysis seamlessly while maintaining perfect compatibility with Microsoft Excel formats.

  1. 1. Open your workbook: Launch WPS Spreadsheet and open your document.
  2. 2. Select the result cell: Click on the cell where you want to output the maximum value.
  3. 3. Enter the formula: Go to the Formula bar and type =IF(COUNT(A1:A10), MAX(A1:A10), "") (adjusting the range as needed).
  4. 4. Execute the calculation: Press Enter to instantly calculate the result without displaying unwanted zeros.
Fully compatible with Microsoft Excel (.xlsx, .xls) formulas and formatting.Built-in formula error checking and syntax highlighting.Lightweight application with fast processing for large datasets.Free to use with a familiar, user-friendly interface.
microsoft office alternative - wps office

Frequently Asked Questions

Why does the MAX function return 0 for empty cells?

By default, statistical functions like MAX and MIN treat an entirely empty range or a range containing only text as having a numeric value of 0. This is a standard spreadsheet behavior to avoid calculation errors.

Can I use this formula with the MIN function as well?

Yes, you can replace MAX with MIN in the formula: =IF(COUNT(K106:O110), MIN(K106:O110), ""). This prevents the MIN function from returning 0 when the targeted range is empty.

What if my range contains text instead of being blank?

The COUNT function specifically evaluates only numeric values. If your range contains text but no numbers, COUNT will return 0, and the IF formula will still correctly output a blank cell instead of a zero.

How do I hide zero values in the entire worksheet instead of using a formula?

You can hide all zero values globally by going to the application's Options menu, navigating to the View or Advanced settings, and unchecking the 'Show a zero in cells that have zero value' option. However, using the IF/COUNT formula is recommended if you only want to target specific cells without affecting the rest of your data.