Formula Errors

Fix an Excel IF Formula That Returns Charge Instead of No Fee

John WilsonJohn Wilson Dec 2, 2026 868 views

Question details

Return No Fee when A1 contains either specified status and Charge for other values.

Fix an Excel IF Formula That Returns Charge Instead of No Fee
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).
Before you start

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.

Solution 1Recommended

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.

1
Check the text length

In an empty cell, enter =LEN(A1). Compare the result with =LEN("OnTime (Inside Window)") to see whether A1 has extra or missing characters.

2
Enter the IF formula

Select the cell where the fee should appear and enter =IF(OR(A1="Early (Inside Window)",A1="OnTime (Inside Window)"),"No Fee","Charge").

3
Test both statuses

Enter each expected label in A1 and confirm that the formula returns No Fee. Enter a different status to confirm that it returns Charge.

Check the status text and use IF with OR
A length match is not conclusive: Different characters can have the same length. If the length matches but the result is still Charge, inspect the text or use the cleaning solution below.
Use WPS Spreadsheet

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. 1. Open the workbook: Open WPS Office, select Spreadsheet, and open the workbook containing the status in A1.
  2. 2. Enter the formula: Select the result cell and enter =IF(OR(A1="Early (Inside Window)",A1="OnTime (Inside Window)"),"No Fee","Charge").
  3. 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. 4. Save the workbook: Use File > Save or Save As to save the updated workbook in Excel XLSX format.
Calculate fee results with IF and OR formulasInspect status text with LEN and clean it with TRIMOpen and save Microsoft Excel XLSX filesWork in a familiar spreadsheet interface
microsoft office alternative - wps office

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.