Function Problems

Excel Formula to Return the Latest Workflow Step by ID

Steve KSteve K Oct 23, 2026 869 views

Question details

The user needs to retrieve the workflow step name corresponding to the date closest to today for a specific assessment ID.

Excel Formula to Return the Latest Workflow Step by ID
Product
Excel
Device & OS
not provided
Scenario
Tracking project or assessment workflows where multiple steps are logged with different dates, and the user must dynamically identify the step nearest to the current date based on a selected ID.
Observed behavior
The user is looking for a functional formula combination to filter the dataset by ID, evaluate the date proximity to today, and output the correct workflow step name.
Before you start

Ensure your dataset is organized in a structured table with clearly defined columns for Assessment ID, Date, and Workflow Step, and verify that all date cells are properly formatted as date values rather than text.

Solution 1Recommended

Use FILTER, ABS, and MIN Functions in Microsoft 365 or Excel 2021

By combining modern dynamic array functions, you can filter your dataset by the target ID, calculate the absolute difference between the dates and today's date, and extract the matching step name.

This solution relies on dynamic array functions available in newer versions of Excel (Microsoft 365 and Office 2021). It calculates the difference between your target dates and today's date, identifying the smallest gap to find the closest match.

1
Filter records by Assessment ID

Use the FILTER function to isolate the dates and workflow steps that match your selected assessment ID. This creates a temporary array of only the relevant records.

2
Calculate the date difference

Subtract TODAY() from the filtered date array and wrap the operation in the ABS() function. This calculates the absolute number of days between each workflow step and today, regardless of whether the date is in the past or future.

3
Find the smallest date gap

Wrap your absolute difference calculation in the MIN() function. This will return the smallest numerical difference, representing the date closest to today.

4
Return the matching workflow step

Use another FILTER or an XLOOKUP function to return the workflow step name where the date difference exactly matches the minimum difference calculated in the previous step.

Use FILTER, ABS, and MIN Functions in Microsoft 365 or Excel 2021
Formula Customization: You can streamline this using the LET function to define variables for your filtered dates and differences, making the formula easier to read and adjust to your specific column references.
Advanced Data Analysis

Solve Complex Date Filtering Issues with WPS Spreadsheet

WPS Spreadsheet fully supports advanced dynamic array formulas and date functions, making it incredibly simple to filter data and calculate date differentials without needing complex workarounds.

  1. 1. Open your workflow data: Launch WPS Spreadsheet and open the .xlsx file containing your assessment IDs, dates, and workflow steps.
  2. 2. Select the output cell: Click on the cell where you want the latest workflow step name to appear.
  3. 3. Input the array formula: Type your combination of FILTER, MIN, and ABS functions referencing your table columns and press Enter.
  4. 4. Format and save: Ensure your results display correctly, then save your spreadsheet seamlessly in the standard Excel format.
Full compatibility with advanced Microsoft Excel formulas like FILTER and XLOOKUPSeamless support for .xlsx file formats without losing data structureLightweight, fast-loading interface ideal for handling large datasetsFree to use with built-in data analysis templates
microsoft office alternative - wps office

Frequently Asked Questions

How do I find the absolute latest date if I don't care about how close it is to today?

If you only want the most recent date in the past (the maximum date), you can substitute the ABS and TODAY() logic with the MAX() function applied to your filtered date array.

Why does my formula return a #CALC! or #VALUE! error?

A #CALC! error usually means the FILTER function found no matching assessment IDs. A #VALUE! error indicates that some cells in your date column are formatted as text instead of valid date serial numbers.

Can I achieve this in older versions of Excel without the FILTER function?

Yes. In older versions like Excel 2016 or 2019, you must use an array formula combining INDEX, MATCH, MIN, and IF. You will need to press Ctrl+Shift+Enter to execute it as an array formula.