Create First and Last Entry Logs Using Excel LAMBDA Functions
Question details
The user wants to implement custom LAMBDA functions to track the first and most recent entries in a dataset for data governance purposes.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Tracking changes and maintaining data quality by easily retrieving the earliest and latest records logged in a continuous dataset.
- Observed behavior
- A need to consistently extract the first and last entry logs using custom named formulas rather than repeatedly writing complex lookup arrays.
Ensure your spreadsheet software is updated to a version that supports the LAMBDA function, as older versions do not have the capability to create custom named functions.
Define FirstEntryLog and LastEntryLog in the Name Manager
Use the Name Manager to create custom, reusable LAMBDA functions for fetching the first and last entries in your dataset.
LAMBDA functions allow you to define custom, reusable formulas without needing VBA or complex macros.
By setting up these formulas in the Name Manager, you can call them anywhere in your workbook by simply typing the names you assign, ensuring consistent entry logging and simplified data governance.
Navigate to the Formulas tab on the ribbon and click on 'Name Manager'.
Click 'New'. In the Name field, type 'FirstEntryLog'. In the 'Refers to' field, input your custom LAMBDA formula designed to fetch the first entry (e.g., using INDEX/MATCH or XLOOKUP logic), and click OK.
Click 'New' again. Name it 'LastEntryLog' and input the corresponding LAMBDA formula for retrieving the most recent entry in the 'Refers to' field.
Select an empty cell and type '=FirstEntryLog(your_range)' or '=LastEntryLog(your_range)' to extract the desired log data.

Manage Complex Data Logs with WPS Spreadsheet
WPS Spreadsheet offers powerful formula management tools, allowing you to handle advanced array formulas and custom name definitions seamlessly for all your data governance needs.
- 1. Launch WPS Spreadsheet: Open WPS Office and load the workbook where you want to implement entry logs.
- 2. Access the Name Manager: Go to the Formulas tab and click on Name Manager to start defining your custom data tracking functions.
- 3. Define and Apply Formulas: Set up your tracking logic within the Name Manager, then apply the names directly in your cells to monitor dataset entries.

Frequently Asked Questions
Why is my LAMBDA function returning a #NAME? error?
This error typically occurs if your spreadsheet software version does not support the LAMBDA function, or if the function name was misspelled or not correctly defined in the Name Manager.
Can I track the exact time of the first and last entry using these functions?
Yes, if your dataset includes a timestamp column, you can structure your LAMBDA function to return the timestamp associated with the first or last entry corresponding to a specific row or item ID.
Are custom LAMBDA functions compatible between different spreadsheet programs?
LAMBDA is natively supported in newer versions of Microsoft 365. When sharing files with users on older versions or alternative software, the functions may not evaluate correctly unless the software has been updated to support modern array and LAMBDA features.




