Fix an Excel IF Formula Returning 5 for a Blank-Looking Cell
Question details
Prevent an IF formula from returning 5 when its referenced cell appears blank because another formula returns an empty string.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- An IF formula checks whether a referenced cell is greater than zero and returns 5 when the condition is met.
- Observed behavior
- The formula returns 5 even though the referenced cell appears blank; that cell contains a formula that returns an empty string.
Select the cell that appears blank and check the formula bar to see whether it contains a formula returning an empty string. Identify the cell reference used by the IF formula; the example below uses A1.
Check for an Empty String Before the Numeric Condition
Use a nested IF formula to leave the result blank when the referenced cell is empty or displays an empty string.
A cell containing a formula that returns "" is not truly blank. Check its displayed result before testing whether it is greater than zero.
Click the cell containing the IF formula that unexpectedly returns 5.
In the formula bar, enter =IF(A1="","",IF(A1>0,5,"")), replacing A1 with your referenced cell.
Press Enter. Verify that the result is blank when the referenced cell displays an empty string and shows 5 when it contains a number greater than zero.

Handle Blank-Looking Cells in WPS Spreadsheets
Use a nested IF formula in WPS Spreadsheets to check for an empty string before evaluating a numeric condition.
- 1. Open the workbook: Open WPS Spreadsheets and select Open to load your workbook.
- 2. Select the result cell: Click the cell where you want the IF formula to appear.
- 3. Enter the formula: In the formula bar, enter =IF(A1="","",IF(A1>0,5,"")), replacing A1 with the relevant cell reference.
- 4. Check and save: Press Enter, verify the result, and choose File > Save to save the workbook.

Frequently Asked Questions
Why is a cell with a formula that returns an empty string not truly blank?
The cell still contains a formula, even though its result displays no characters. Select the cell and check the formula bar to see its contents.
Can I use ISBLANK to detect a formula returning an empty string?
No. ISBLANK(A1) returns FALSE when A1 contains a formula. To check for an empty-string result, use A1="" instead.
What does the formula return when A1 is zero?
The formula =IF(A1="","",IF(A1>0,5,"")) returns an empty string when A1 is zero or negative, and returns 5 when A1 is greater than zero.
Will the empty-string check detect a cell containing spaces?
No. Spaces are text characters, so A1="" will not treat a cell containing spaces as empty. Select the cell and inspect or remove the spaces if appropriate.




