Function Problems

Excel: Use IFS and COUNTIF to Return a Status Across a Row

Nimra MalikNimra Malik Nov 12, 2026 869 views

Question details

Create a formula that checks daily status cells across one row and returns Yes, No, or Absent.

Use IFS and COUNTIF to Return Yes, No, or Absent Across an Excel Row
Product
Microsoft Excel
Device & OS
not provided
Scenario
The user needs to summarize status values in cells AB27:AH27 into one result based on a priority order.
Observed behavior
The result should return Yes when any cell contains yes, then No when any cell contains no, and then Absent when any cell contains absent.
Before you start

Make sure the status entries in AB27:AH27 use consistent text such as yes, no, and absent. COUNTIF is not case-sensitive, but extra spaces in a cell can prevent an exact match.

Solution 1Recommended

Return Yes, No, or Absent by Priority Across the Row

Use this formula when Yes should take priority over No, and No should take priority over Absent.

The formula tests the row from left to right by condition priority, not by the position of the status in the row. If more than one status exists, it returns the first matching result in the formula.

1
Select the result cell

Click the cell where you want the row summary to appear, such as AI27.

2
Enter the IFS and COUNTIF formula

Type or paste: =IFS(COUNTIF(AB27:AH27,"yes"),"yes",COUNTIF(AB27:AH27,"no"),"no",COUNTIF(AB27:AH27,"absent"),"absent")

3
Press Enter and fill down

Press Enter to calculate the result. Drag the fill handle down if other rows use the same AB:AH status layout.

Return Yes, No, or Absent by Priority Across the Row
Priority order: This formula returns yes whenever at least one cell contains yes, even if the same row also contains no or absent.
WPS Spreadsheet formulas

Summarize Daily Row Statuses with IFS and COUNTIF in WPS Spreadsheet

WPS Spreadsheet supports IFS, COUNTIF, and IFERROR formulas for summarizing daily status cells into a single result. Enter the formula in your summary column, then fill it down to evaluate each row consistently.

  1. 1. Open the worksheet in WPS Spreadsheet: Open the Excel workbook in WPS Office and select the sheet containing the AB27:AH27 daily-status range.
  2. 2. Select a summary cell: Click the cell beside the row, such as AI27, where the combined status should appear.
  3. 3. Enter the formula: In the formula bar, enter =IFS(COUNTIF(AB27:AH27,"yes"),"yes",COUNTIF(AB27:AH27,"no"),"no",COUNTIF(AB27:AH27,"absent"),"absent") and press Enter.
  4. 4. Apply the formula to other rows: Select the result cell and drag its fill handle down to copy the adjusted formula to additional rows.
Use IFS and COUNTIF to prioritize Yes, No, and Absent results.Fill the formula down quickly for multiple daily-status rows.Open and edit Microsoft Excel .xlsx and .xls workbooks with formula compatibility.Use a familiar spreadsheet interface for Excel-style functions and cell references.
microsoft office alternative - wps office

Frequently Asked Questions

What happens if a row contains both yes and no?

The formula returns yes because the first IFS condition checks for yes. Reorder the conditions if you need a different priority.

Can I change the range from AB27:AH27 to another row range?

Yes. Replace AB27:AH27 in every COUNTIF function with your status range, such as C27:I27.

Why does the formula not recognize a status that looks correct?

Check for leading or trailing spaces, such as " yes" or "absent ". COUNTIF matches the text criterion exactly apart from letter case.

How can I return blank when none of the statuses is found?

Wrap the formula with IFERROR and use an empty string as the fallback: =IFERROR(IFS(COUNTIF(AB27:AH27,"yes"),"yes",COUNTIF(AB27:AH27,"no"),"no",COUNTIF(AB27:AH27,"absent"),"absent"),"")

Does COUNTIF distinguish between Yes and yes?

No. COUNTIF is case-insensitive, so yes, Yes, and YES are treated as the same matching status.