How to Mark the Latest Matching Date as Migrate in Excel
Question details
The user needs to compare columns C, D, and E, find the maximum date in column L for each matching group, and mark the latest record as Migrate while earlier matching records are marked Do not migrate in Excel.

- Product
- WPS Office Excel
- Device & OS
- not provided
- Scenario
- Working with a data table where each group is identified by values in columns C, D, and E, and only the row with the latest date in column L should be flagged for migration.
- Observed behavior
- The latest matching date needs to be flagged as Migrate, and earlier matching dates need to be flagged as Do not migrate.
Confirm that column L contains real Excel dates rather than text and that your data starts in row 2 with headers in row 1. If the formula returns #NAME?, use a version of Excel or WPS Office that supports MAXIFS.
Use MAXIFS to Mark the Latest Matching Date as Migrate
Best when you want one formula that compares each group by columns C, D, and E and flags the row with the latest date in column L.
MAXIFS returns the maximum date in column L for all rows where columns C, D, and E match the current row. The IF function then compares each row's date in L to that maximum: if they are equal, the row is marked Migrate; otherwise, it is marked Do not migrate.
Click the cell in row 2 where you want the migration status to appear, such as M2.
Type =IF(L2=MAXIFS($L$2:$L$1000,$C$2:$C$1000,C2,$D$2:$D$1000,D2,$E$2:$E$1000,E2),"migrate","Do not migrate") and press Enter.
Drag the fill handle from M2 down through the last data row to apply the formula to all records.

Add a Tie-Breaker to Mark Only One Duplicate Latest Date
Use this when duplicate rows share the same maximum date and you need exactly one row marked Migrate.
Mark the Latest Matching Date as Migrate with WPS Office Excel
WPS Office Excel supports the MAXIFS formula, so you can open your workbook, enter the group comparison formula, and automatically flag the latest date per group as Migrate while marking earlier dates Do not migrate.
- 1. Open the workbook in WPS Office Excel: Launch WPS Office and open the Excel file that contains columns C, D, E, and L.
- 2. Enter the MAXIFS formula: Click the first status cell and enter =IF(L2=MAXIFS($L$2:$L$1000,$C$2:$C$1000,C2,$D$2:$D$1000,D2,$E$2:$E$1000,E2),"migrate","Do not migrate").
- 3. Copy the formula through all data rows: Use the fill handle to drag the formula down from the first status cell through the last row.
- 4. Review the migrate flags: Filter the status column or sort by the group columns to verify that only the latest matching date per group is marked Migrate.

Frequently Asked Questions
Why do all rows with the same maximum date get marked as Migrate?
The basic MAXIFS formula marks every row whose date in column L equals the group maximum. If two or more rows share that maximum, all of them will show Migrate unless you add a tie-breaking rule such as COUNTIFS or a unique row ID.
Can I use this formula in older versions of Excel?
MAXIFS is available in Excel 2019, Excel for Microsoft 365, and WPS Office Excel. In older Excel versions that do not support MAXIFS, you can use an array formula with MAX and IF instead.
Does WPS Office Excel support MAXIFS?
Yes. WPS Office Excel supports MAXIFS and can open, edit, and save Microsoft Excel .xlsx files with full formula compatibility.
What should I check if the formula returns #NAME?
#NAME? usually means your spreadsheet application does not recognize MAXIFS or the function name was misspelled. Check that you are using WPS Office Excel or a compatible Excel version and that the function is typed exactly as MAXIFS.
How can I mark only one row when multiple rows share the latest date?
Add a helper column that counts identical date occurrences within each group, such as =COUNTIFS($C$2:C2,C2,$D$2:D2,D2,$E$2:E2,E2,$L$2:L2,L2). Then require that the helper column equals 1 in your Migrate condition.




