Function Problems

Make an Excel Formula Return a Blank Unless a Cell Contains X

Tauseeq MagsiTauseeq Magsi Dec 2, 2026 868 views

Question details

Show a formula result only when another cell contains an uppercase or lowercase X.

Make an Excel Formula Return a Blank Unless a Cell Contains X
Product
Microsoft Excel
Device & OS
not provided
Scenario
A control cell determines whether a calculated result should appear.
Observed behavior
The calculated cell should display its result when the control cell contains X or x and appear blank otherwise.
Before you start

Identify the cell that controls the result and the calculation you want to show. The example below uses C2 as the control cell and checks for X or x as the entire cell value.

Solution 1Recommended

Use IF and UPPER to Check for X in Excel

Wrap an existing calculation in an IF formula to display it only when the control cell contains X or x.

1
Select the result cell

Click the cell where you want the calculated result to appear.

2
Enter the IF formula

In the formula bar, enter =IF(UPPER(C2)="X",A2+B2,""). Replace A2+B2 with your calculation, without its leading equals sign, and replace C2 if your control cell is different.

3
Test the result

Press Enter, then type X or x in C2 to show the calculation. Clear C2 or enter another value to make the result appear blank.

Use IF and UPPER to Check for X in Excel
Blank-looking result: The formula returns an empty string when the condition is not met; the cell still contains a formula. The check matches X or x alone, not text such as "X approved".
WPS Spreadsheets

Show Conditional Results in WPS Spreadsheets

Use the same IF and UPPER formula in WPS Spreadsheets to display a calculation only when a control cell contains X or x.

  1. 1. Open the spreadsheet: Open WPS Spreadsheets and use Open to select your workbook.
  2. 2. Select the result cell: Click the cell where you want to display the conditional calculation.
  3. 3. Enter the formula: In the formula bar, enter =IF(UPPER(C2)="X",A2+B2,""). Replace C2 and A2+B2 with your control cell and calculation.
  4. 4. Check the condition: Press Enter, then type X or x in C2 to check that the result appears.
Show calculation results only when the control cell contains X or xOpen and edit Microsoft Excel XLSX and XLS filesUse familiar spreadsheet formulas and a formula bar
microsoft office alternative - wps office

Frequently Asked Questions

Does the formula work with both X and x?

Yes. UPPER(C2) converts lowercase x to uppercase X before the IF formula compares it with "X".

Why does a cell containing other text with X not trigger the calculation?

The formula checks whether the entire value in C2 is X or x. For an X anywhere in the cell, use =IF(ISNUMBER(SEARCH("X",C2)),A2+B2,"") and replace A2+B2 with your calculation.

Is the result cell truly empty when the condition is false?

No. The cell contains the IF formula, which returns an empty string displayed as blank.

How do I use my existing calculation in the formula?

Replace A2+B2 in =IF(UPPER(C2)="X",A2+B2,"") with your calculation, omitting the calculation's leading equals sign.