Function Problems

Fix an Excel IFS Formula That Misses Text Values

Tauseeq MagsiTauseeq Magsi Nov 18, 2026 868 views

Question details

Find out why an Excel IFS formula does not match certain text values.

Fix an Excel IFS Formula That Misses 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.
Before you start

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.

Solution 1Recommended

Remove Extra Spaces in the Excel IFS Formula

Use TRIM when leading or trailing ordinary spaces prevent a text value from matching.

1
Inspect the source value

Select cell F80 and check the formula bar for extra spaces, spelling differences, or punctuation such as an underscore.

2
Add TRIM to the formula

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").

3
Test the result

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.

Remove Extra Spaces in the Excel IFS Formula
What TRIM removes: TRIM removes ordinary leading and trailing spaces and reduces repeated ordinary spaces between words. It does not remove nonbreaking spaces.
WPS Spreadsheets

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. 1. Open the workbook: In WPS Office, open WPS Spreadsheets and select the workbook containing the source text.
  2. 2. Locate the source cell: Select the sheet and identify the cell containing the option, such as F80.
  3. 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. 4. Test and save: Press Enter, check the results for the text options, and use File > Save to save the workbook.
Clean source text and map options to results in a spreadsheet formulaOpen and save Microsoft Excel XLSX filesWork with formulas in a familiar spreadsheet interface
microsoft office alternative - wps office

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.