Fix an Excel IF Formula That Returns Charge Instead of No Fee
Question details
Return No Fee when A1 contains either specified status and Charge for other values.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet uses an IF formula to determine a fee from the status text in cell A1.
- Observed behavior
- The formula unexpectedly returns Charge for OnTime (Inside Window).
Check that A1 is the cell containing the status and that the expected labels are exactly Early (Inside Window) and OnTime (Inside Window). Enter formulas in a different cell so the status remains available for comparison.
Check the status text and use IF with OR
Use this approach when the status should exactly match one of the two labels.
A correctly written nested IF can also produce the right result. Unexpected spaces or hidden characters in A1 can prevent an exact text match.
In an empty cell, enter =LEN(A1). Compare the result with =LEN("OnTime (Inside Window)") to see whether A1 has extra or missing characters.
Select the cell where the fee should appear and enter =IF(OR(A1="Early (Inside Window)",A1="OnTime (Inside Window)"),"No Fee","Charge").
Enter each expected label in A1 and confirm that the formula returns No Fee. Enter a different status to confirm that it returns Charge.

Clean hidden characters before comparing the status
Use a helper cell when the status may contain extra spaces, nonbreaking spaces, or line breaks.
Calculate the Fee Status in WPS Spreadsheet
Use WPS Spreadsheet to check the status text and apply the same IF and OR formula to return No Fee or Charge.
- 1. Open the workbook: Open WPS Office, select Spreadsheet, and open the workbook containing the status in A1.
- 2. Enter the formula: Select the result cell and enter =IF(OR(A1="Early (Inside Window)",A1="OnTime (Inside Window)"),"No Fee","Charge").
- 3. Check unexpected results: If the result is unexpectedly Charge, enter =LEN(A1) in an empty cell and inspect A1 for extra characters or spaces.
- 4. Save the workbook: Use File > Save or Save As to save the updated workbook in Excel XLSX format.

Frequently Asked Questions
Why does my nested IF return Charge for OnTime (Inside Window)?
The nested IF may be logically correct, but A1 may contain an extra space or hidden character. Enter =LEN(A1) in an empty cell and compare it with =LEN("OnTime (Inside Window)").
Can I use TRIM directly in the IF formula?
Yes. For ordinary extra spaces, enter =IF(OR(TRIM(A1)="Early (Inside Window)",TRIM(A1)="OnTime (Inside Window)"),"No Fee","Charge"). TRIM alone does not remove nonbreaking spaces.
How do I handle a nonbreaking space in the status?
In a helper cell, use =TRIM(SUBSTITUTE(A1,CHAR(160)," ")) to replace common nonbreaking spaces with ordinary spaces and trim the result. Point the IF formula to that helper cell.
Does the formula distinguish between uppercase and lowercase text?
No. Excel's standard equality comparison is not case-sensitive, so the formula treats different capitalization as a match. Extra spaces or different characters can still prevent a match.




