Formula Errors

Assign Sequential Ranks by Multiple Criteria in Excel

Adam DavisAdam Davis Nov 25, 2026 869 views

Question details

Assign an incrementing rank to records with matching Part, Oper, and Date values, starting each group at 1.

Assign Sequential Ranks by Multiple Criteria in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet contains records that need to be numbered within each combination of Part, Oper, and Date, potentially without sorting the data.
Observed behavior
Each matching group should receive ranks 1, 2, 3, and so on in worksheet order, even when its records are not adjacent.
Before you start

Identify the columns containing Part, Oper, and Date and choose an empty column for the ranks. The examples assume headers in row 1, Part in column A, Oper in column C, Date in column D, and ranks in column E; adjust the references if your layout differs.

Solution 1Recommended

Use COUNTIFS to rank matching records without sorting

Use this method when matching records are scattered or sorting could affect other formulas.

COUNTIFS counts matching records from the first data row through the current row, so each group is numbered in its existing worksheet order.

1
Enter the first rank formula

In cell E2, enter =COUNTIFS(A$2:A2,A2,C$2:C2,C2,D$2:D2,D2).

2
Fill down

Select E2 and drag the fill handle down column E through the last data row. Each combination of Part, Oper, and Date starts at 1 and increments on later matches.

Use COUNTIFS to rank matching records without sorting
Check date values: Date cells that look identical can contain different times. If the rank should group by calendar date only, use date-only values in the Date column or a helper column.
Rank records in WPS Spreadsheets

Create Sequential Group Ranks in WPS Spreadsheets

Use COUNTIFS in WPS Spreadsheets to number records within each Part, Oper, and Date group without rearranging the worksheet.

  1. 1. Open the spreadsheet: Open WPS Spreadsheets and use Open to select your workbook.
  2. 2. Enter the formula: With Part in column A, Oper in C, and Date in D, enter =COUNTIFS(A$2:A2,A2,C$2:C2,C2,D$2:D2,D2) in E2.
  3. 3. Fill the rank column: Select E2 and drag its fill handle down to the last record. Adjust the column references if your data uses a different layout.
  4. 4. Save the workbook: Use File > Save As to save the completed spreadsheet in XLSX format.
Rank matching records without sortingOpen and save Microsoft Excel XLSX filesUse familiar spreadsheet formulas and fill controlsWork with a free spreadsheet application
QA img-9

Frequently Asked Questions

Can I rank matching records without sorting them?

Yes. Enter =COUNTIFS(A$2:A2,A2,C$2:C2,C2,D$2:D2,D2) in E2 and fill it down. The formula counts each group in its existing row order.

Why do two dates that look the same get separate ranks?

The cells may contain different time values even if their formatting shows only the date. Use date-only values or a helper column, then point the COUNTIFS date ranges and criteria to that column.

Will the ranks change if I reorder the rows?

Yes. The COUNTIFS formula numbers matches according to their current worksheet order. Reordering records can change which record receives each rank.

What if my grouping fields are in different columns?

Replace the A, C, and D references in both the COUNTIFS ranges and their corresponding criteria with the columns containing your Part, Oper, and Date values.