Fix an Excel IFS Formula That Misses Text Values
Question details
Find out why an Excel IFS formula does not match certain text values.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- An IFS formula maps text options in a source cell to different results.
- Observed behavior
- The formula works for most options but does not match values such as Self or Other_Clinician.
Identify the source cell and check the exact text the formula should match. The examples below use F80; replace it with your source cell if needed.
Remove Extra Spaces in the Excel IFS Formula
Use TRIM when leading or trailing ordinary spaces prevent a text value from matching.
Select cell F80 and check the formula bar for extra spaces, spelling differences, or punctuation such as an underscore.
Select the cell containing the IFS formula and enter =IFS(TRIM(F80)="MD","1",TRIM(F80)="Self","2",TRIM(F80)="Other_Clinician","3",TRIM(F80)="PFRC","4",TRIM(F80)="Other","5",TRUE,"No match").
Press Enter, then check the result for Self and Other_Clinician. If the formula returns No match, compare the source text with the conditions again.

Check for Nonbreaking Spaces and Text Differences
Use this check if TRIM alone does not make the text match.
Fix Text Matching Formulas in WPS Spreadsheets
Open the workbook in WPS Spreadsheets and use TRIM with a nested IF formula to map text options while removing extra ordinary spaces.
- 1. Open the workbook: In WPS Office, open WPS Spreadsheets and select the workbook containing the source text.
- 2. Locate the source cell: Select the sheet and identify the cell containing the option, such as F80.
- 3. Enter a matching formula: Select the result cell and enter =IF(TRIM(F80)="MD","1",IF(TRIM(F80)="Self","2",IF(TRIM(F80)="Other_Clinician","3",IF(TRIM(F80)="PFRC","4",IF(TRIM(F80)="Other","5","No match"))))). Replace F80 if your source cell is different.
- 4. Test and save: Press Enter, check the results for the text options, and use File > Save to save the workbook.

Frequently Asked Questions
Why does my IFS formula not recognize Self?
The source cell may contain extra spaces or a spelling difference. Select the cell and inspect the formula bar, or use TRIM on the cell in the formula.
Why does TRIM not fix every text match?
TRIM does not remove nonbreaking spaces. In a helper cell, use =TRIM(SUBSTITUTE(F80,CHAR(160)," ")) to replace them before comparing the text.
What happens if none of the IFS conditions match?
IFS returns #N/A if no condition is true and no fallback is provided. Add TRUE,"No match" as the final condition and result to display a message instead.
Is Excel text comparison case-sensitive in an IFS formula?
A standard comparison such as F80="Self" is not case-sensitive. To require an exact case match, use EXACT(F80,"Self") as the IFS condition.




