Excel Formula to Display Y When It Appears in a Range
Question details
Display Y if a cell in P4:X4 contains Y, and otherwise leave the formula cell blank.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Check a row of cells for Y and show the result in a separate cell.
- Observed behavior
- The result should be Y when a match is found and appear blank when there is no match.
Decide whether a cell must equal Y or whether Y can appear within longer text. Enter the formula outside P4:X4 to avoid a circular reference.
Display Y for an Exact Cell Match in Excel
Use this formula when a cell must contain only Y to count as a match.
In Excel, select a cell outside P4:X4, such as Y4.
Type =IF(COUNTIF(P4:X4,"Y")>0,"Y","") and press Enter.
Enter Y in a cell in P4:X4 to see Y in the result cell. Remove it, or replace it with other text, to see the result appear blank when no other cell matches.

Display Y When It Appears Within Cell Text
Use wildcard matching when Y can be part of a longer text value.
Check a Range for Y in WPS Spreadsheet
Use the same IF and COUNTIF formulas in WPS Spreadsheet to display Y for a matching cell or show a blank when no match is found.
- 1. Open your spreadsheet: Open WPS Spreadsheet and use Open to select your workbook.
- 2. Choose a result cell: Select a cell outside P4:X4, such as Y4.
- 3. Enter the formula: Type =IF(COUNTIF(P4:X4,"Y")>0,"Y","") and press Enter. For a partial match, replace "Y" inside COUNTIF with "*Y*".
- 4. Save the workbook: Use File > Save to keep the formula in your workbook.

Frequently Asked Questions
Does the exact-match formula recognize lowercase y?
Yes. COUNTIF is not case-sensitive, so =IF(COUNTIF(P4:X4,"Y")>0,"Y","") matches both Y and y.
How do I match Y inside a longer word?
Use =IF(COUNTIF(P4:X4,"*Y*")>0,"Y",""). The asterisks allow text before or after Y.
Why does the formula show Y when a cell contains Yes?
The wildcard criterion "*Y*" matches Y anywhere in the text. Use the exact criterion "Y" instead if the entire cell must equal Y.
Is the result cell truly empty when there is no match?
No. The IF formula returns an empty text string ("") when there is no match, so the cell appears blank but still contains a formula.




