How to Return a Blank Instead of Zero with the MAX Function
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.

- 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.
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.
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.
Click on the cell where you want the maximum value to appear.
Type the formula =IF(COUNT(K106:O110), MAX(K106:O110), ""), replacing K106:O110 with your actual data range.
Press Enter to apply the formula. If the range has numbers, the maximum is shown; if not, the cell remains blank.

Use IF, AND, and ISBLANK for Strictly Empty Ranges
This alternative approach checks if the entire range is completely blank before calculating the maximum value.
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. Open your workbook: Launch WPS Spreadsheet and open your document.
- 2. Select the result cell: Click on the cell where you want to output the maximum value.
- 3. Enter the formula: Go to the Formula bar and type =IF(COUNT(A1:A10), MAX(A1:A10), "") (adjusting the range as needed).
- 4. Execute the calculation: Press Enter to instantly calculate the result without displaying unwanted zeros.

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.




