Function Problems

Sort Excel Rows by the Number of Yes Values in WPS Office

Ayan MasoodAyan Masood Nov 13, 2026 869 views

Question details

The user needs to reorder Excel rows based on how many Yes responses appear in columns F through M, placing rows with the highest totals at the top.

Sort Excel Rows by the Number of Yes Values in WPS Office
Product
WPS Office Spreadsheet
Device & OS
not provided
Scenario
Analyzing survey, checklist, or scoring data where each row has Yes responses in columns F through M and needs to be prioritized by total positive responses.
Observed behavior
Rows remain in their original order because the worksheet has no count field to sort by.
Before you start

Make sure the Yes values are entered consistently in columns F through M. The formula counts cells exactly matching “Yes”, so remove extra spaces or inconsistent wording before sorting if you need accurate totals.

Solution 1Recommended

Add a COUNTIF Helper Column and Sort Descending in WPS Spreadsheet

Use this method when you want to rank entire rows by the number of Yes responses in columns F through M, from highest to lowest.

The COUNTIF function checks each row range F2:M2 for the text "Yes" and returns the total. Sorting by this helper column keeps all other row data together while changing the row order.

1
Open the workbook in WPS Spreadsheet

Open the Excel file in WPS Office Spreadsheet and make sure the sheet containing the Yes/No responses is active.

2
Enter the COUNTIF formula in a helper column

Click the first blank cell next to your data, such as N2, enter =COUNTIF(F2:M2,"Yes"), and press Enter.

3
Fill the formula down all data rows

Select N2, then drag the fill handle down through the last row of data to copy the COUNTIF formula to every row.

4
Sort the table by the helper column

Select the entire table including the helper column, go to the Data tab, click Sort, choose the helper column in the Sort dialog, set the order to Descending, and click OK.

Add a COUNTIF Helper Column and Sort Descending in WPS Spreadsheet
Rows are now sorted by Yes count: The row with the highest number of Yes responses in F:M appears at the top, and later rows follow in descending order.
WPS Office solution

Count Yes Responses and Sort Rows with WPS Spreadsheet

Use a COUNTIF helper column in WPS Office Spreadsheet to total Yes values in F2:M2, then sort descending so the rows with the most Yes responses appear first.

  1. 1. Open your workbook: Open the .xlsx workbook in WPS Office Spreadsheet.
  2. 2. Add the helper column formula: Click N2, type =COUNTIF(F2:M2,"Yes"), and press Enter.
  3. 3. Copy the formula down: Drag the fill handle from N2 to the last data row to calculate each row's Yes count.
  4. 4. Select the data and open Sort: Select all data including the helper column, click the Data tab, and then click Sort.
  5. 5. Sort by the Yes count: In the Sort dialog, set the column to the helper column, choose Descending, and click OK.
Ranks rows by Yes totals while keeping all existing columns and data intactUses the standard COUNTIF formula for full Microsoft Excel .xlsx compatibilityWorks in the free WPS Office spreadsheet with a familiar Data > Sort workflow
microsoft office alternative - wps office

Frequently Asked Questions

Can I use a different range than F through M?

Yes. Replace F2:M2 in the formula with the actual range where your Yes responses are stored, then fill the formula down and sort by the helper column.

Does COUNTIF distinguish between uppercase and lowercase yes?

No, the COUNTIF function in WPS Spreadsheet is case-insensitive, so "Yes", "yes", and "YES" will all be counted. However, extra spaces or different wording can cause rows to be missed.

Do I have to place the helper column immediately after column M?

No. Any blank column in the table or worksheet can be used. Just make sure the helper column is included when you select the sorting range.

Will sorting by the helper column keep each row intact?

Yes, when you select the entire table or allow WPS Spreadsheet to expand the selection during sorting, all cells in each row move together.