How to Count Values Below a Limit in the Last Three Records per Name in Excel
Question details
The user needs to count how many of the most recent three numerical entries for a specific selected name fall below a certain threshold limit.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Analyzing a dataset containing names and values to find out how many of a specific person's most recent records meet a condition (e.g., value is less than a specified limit).
- Observed behavior
- Requires a functional formula to accurately filter by name, isolate the last three entries, and count those below the limit.
Ensure your dataset is sorted in chronological or sequential order so that the last three records genuinely represent the most recent data entries.
Use LET, FILTER, and TAKE Functions
This is the most efficient method. It uses modern dynamic array functions to filter the data by name, extract the last three records, and count how many are below the threshold.
The LET function allows you to assign a name to the filtered array, making the formula easier to read. The FILTER function narrows down the data to the selected name, and the TAKE function extracts the bottom three records from that filtered list.
Ensure your threshold limit is in a designated cell (e.g., D1) and the target name you want to analyze is in another cell (e.g., E1).
Click on the empty cell where you want the final count to be displayed.
Type the formula: =LET(v,FILTER(A2:A100,B2:B100=E1),SUM(--(TAKE(v,-3)<D1))) into the formula bar. Adjust the ranges A2:A100 (values) and B2:B100 (names) to match your actual dataset.
Press Enter. The formula will return the count of the last three records for the selected name that are less than the value in D1.

Use SUM, IF, TAKE, and FILTER Alternative
If you prefer not to use the LET function, you can nest the dynamic array functions directly inside a SUM and IF statement.
Count Recent Records Using Dynamic Arrays in WPS Spreadsheet
WPS Spreadsheet fully supports modern dynamic array functions like LET, FILTER, and TAKE. You can easily analyze complex datasets, filter by specific criteria, and count recent values without encountering compatibility issues.
- 1. Open your workbook: Launch WPS Spreadsheet and open the file containing your dataset.
- 2. Select the target cell: Click on the cell where you want to calculate the recent records count.
- 3. Input the array formula: Enter =LET(v,FILTER(A2:A100,B2:B100=E1),SUM(--(TAKE(v,-3)<D1))) into the formula bar.
- 4. View your results: Press Enter to execute the formula and instantly view the count of values below your specified limit.

Frequently Asked Questions
How do I count the first three records instead of the last three?
To count the first three records, change the row argument in the TAKE function from a negative number to a positive number. Use TAKE(v, 3) instead of TAKE(v, -3).
What happens if the selected name has fewer than three entries in the list?
The TAKE function handles this gracefully. If there are only one or two entries for a name, TAKE will simply return those available entries without throwing an error, and the formula will evaluate them against your threshold.
Why does my formula return a #NAME? error?
The #NAME? error typically occurs if your spreadsheet software version does not support the newer dynamic array functions like LET, FILTER, or TAKE. Upgrading your software or using WPS Office will resolve this issue.
Does my data need to be sorted for the TAKE function to work correctly?
Yes, the TAKE function extracts records based on their physical position in the dataset. To ensure you are evaluating the chronologically "last three" records, your data must be sorted by date or entry order.




