Function Problems

Create a Dynamic Array of the Most Recent Date by Employee in WPS Spreadsheets

John WilsonJohn Wilson Nov 13, 2026 869 views

Question details

The user needs a single dynamic array formula that lists each unique employee and the most recent date they worked on a team from a roster area with employee names and a date header row.

Create a Dynamic Array of the Most Recent Date by Employee in WPS Spreadsheets
Product
WPS Spreadsheets
Device & OS
not provided
Scenario
The user has a roster range containing employee names and a corresponding date header row, and wants a dynamic result that automatically returns unique employees with their latest dates.
Observed behavior
The expected result is a two-column dynamic roster that updates automatically and sorts the employees by their most recent date in descending order.
Before you start

Confirm that your WPS Spreadsheets version supports the dynamic array functions UNIQUE, TOCOL, BYROW, HSTACK, and SORT. Also make sure the source data uses a consistent layout with employee names in one range and dates in the matching header row.

Solution 1Recommended

Create the Dynamic Roster with UNIQUE, TOCOL, BYROW, HSTACK, and SORT

Use this single formula when you want a spill range that automatically lists each unique employee and their latest date without helper columns or manual refresh.

Place the formula in an empty cell with enough space to spill downward and to the right. The formula scans D4:L9 for employee names, uses D3:L3 as the corresponding date header, and returns a two-column roster sorted by the latest date in descending order.

1
Select the output cell

Click an empty cell where you want the dynamic roster to start, such as N4.

2
Enter the dynamic array formula

Type =SORT(HSTACK(UNIQUE(TOCOL(D4:L9,3,1)),BYROW(UNIQUE(TOCOL(D4:L9,3,1)),LAMBDA(x,MAX(INDEX((x=D4:L9)*D3:L3,))))),2,1).

3
Adjust the source references

Replace D4:L9 with the actual range containing employee names and D3:L3 with the row or range containing the dates. Keep both ranges aligned to the same columns.

4
Confirm the result

Press Enter. WPS Spreadsheets returns a sorted two-column array: employee names and the most recent date for each employee.

Create the Dynamic Roster with UNIQUE, TOCOL, BYROW, HSTACK, and SORT
Dynamic result: The spilled result updates automatically when names or dates in the source range change.

Build a Self-Updating Latest-Date Roster in WPS Spreadsheets

Use WPS Spreadsheets' dynamic array functions to combine UNIQUE, TOCOL, BYROW, HSTACK, and SORT into one formula that returns each employee and their latest date and updates automatically when the data changes.

  1. 1. Open your workbook in WPS Spreadsheets: Launch WPS Office and open the workbook that contains the employee roster and date headers.
  2. 2. Select the output cell: Click an empty cell, such as N4, where you want the dynamic roster to appear.
  3. 3. Enter the formula: Type =SORT(HSTACK(UNIQUE(TOCOL(D4:L9,3,1)),BYROW(UNIQUE(TOCOL(D4:L9,3,1)),LAMBDA(x,MAX(INDEX((x=D4:L9)*D3:L3,))))),2,1) and press Enter.
  4. 4. Update the range references: Adjust D4:L9 and D3:L3 to match the actual employee range and date header row in your sheet.
  5. 5. Verify the sorted result: Confirm that the formula returns employee names and their most recent dates sorted by date descending.
One formula returns unique employees and their latest dates without helper columns.Reads and writes standard .xlsx files for Microsoft Excel compatibility.Updates automatically as employee names or dates are edited.Free and lightweight with a familiar spreadsheet interface.
microsoft office alternative - wps office

Frequently Asked Questions

What does the TOCOL(D4:L9,3,1) part do in this formula?

It scans the roster range D4:L9, ignores blank cells because the second argument is 3, and returns all employee entries in a single column. The UNIQUE function then removes duplicate employee names from that list.

Why is the date header row included as D3:L3?

The formula multiplies the TRUE/FALSE employee match by D3:L3 so that only dates for a specific employee are considered, and MAX returns the most recent date for that employee.

Will the dynamic array formula update automatically when I add employees?

Yes. If your WPS Spreadsheets version supports dynamic arrays, the spill range recalculates when you edit the source range, add new names, or change dates.

What should I do if WPS Spreadsheets returns a #NAME? error?

#NAME? usually means the formula contains a function that is not available in your WPS version. Update WPS Office to a version that supports UNIQUE, TOCOL, BYROW, HSTACK, and SORT, or use a PivotTable as an alternative.

Can I sort the result by employee name instead of by the most recent date?

Yes. Change the SORT formula's sort_index from 2 to 1 and set the sort order to 1 to sort by the employee name column in ascending order.