Function Problems

How to Count Values Below a Limit in the Last Three Records per Name in Excel

Huma Ashraf ChHuma Ashraf Ch Nov 11, 2026 868 views

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.

How to Count Values Below a Limit in the Last Three Records per Name in Excel
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.
Before you start

Ensure your dataset is sorted in chronological or sequential order so that the last three records genuinely represent the most recent data entries.

Solution 1Recommended

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.

1
Set up your criteria cells

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).

2
Select the result cell

Click on the empty cell where you want the final count to be displayed.

3
Enter the formula

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.

4
Apply the calculation

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 LET, FILTER, and TAKE Functions
Counting First Three Records: If you need to analyze the first three records instead of the last three, simply change the argument in the TAKE function from -3 to 3. For example: TAKE(v, 3).
Advanced Data Analysis

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. 1. Open your workbook: Launch WPS Spreadsheet and open the file containing your dataset.
  2. 2. Select the target cell: Click on the cell where you want to calculate the recent records count.
  3. 3. Input the array formula: Enter =LET(v,FILTER(A2:A100,B2:B100=E1),SUM(--(TAKE(v,-3)<D1))) into the formula bar.
  4. 4. View your results: Press Enter to execute the formula and instantly view the count of values below your specified limit.
Fully compatible with Microsoft Excel array formulas and functions.Supports advanced functions like LET, FILTER, and TAKE natively.Lightweight, fast, and free to use for daily data analysis and reporting.Clean, familiar user interface makes formula entry straightforward.
microsoft office alternative - wps office

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.