Function Problems

How to Display the Last Three Values from a Row in Excel

Steve KSteve K Nov 2, 2026 868 views

Question details

The user needs to extract and display the three most recent daily results from an expanding row of data into a separate summary area or a different worksheet.

How to Display the Last Three Values from a Row in Excel
Product
Excel
Device & OS
not provided
Scenario
Creating a dynamic daily results summary where new data is added to the end of a row daily, and a summary section needs to automatically reflect the latest three entries.
Observed behavior
The user wants the summary cells to automatically update with the newest populated cells in the row without having to manually rewrite cell references each day.
Before you start

Ensure that your row of data does not contain empty cells between the daily entries, as dynamic formulas rely on counting the total number of non-blank cells to locate the end of the row accurately.

Solution 1Recommended

Use Dynamic Formulas (INDEX and COUNTA)

The most robust method for a growing dataset, automatically updating the summary whenever you add new daily results to the row.

By combining the INDEX and COUNTA functions, you can instruct Excel to dynamically look at the entire row, count how many cells contain data, and return the values situated at the very end. This means you never have to manually adjust the formula.

1
Select the first summary cell

Click on the cell in your summary area where you want the third-to-last value to appear.

2
Enter the formula for the third-to-last value

Type =INDEX(3:3, COUNTA(3:3)-2) and press Enter. Replace '3:3' with your actual row number. This counts the non-empty cells and steps back two spaces to find the third-to-last entry.

3
Extract the second-to-last value

In the next summary cell, enter =INDEX(3:3, COUNTA(3:3)-1) to pull the second-to-last daily result.

4
Extract the most recent value

In the final summary cell, enter =INDEX(3:3, COUNTA(3:3)) to display the absolute latest data point entered in the row.

Use Dynamic Formulas (INDEX and COUNTA)
Working Across Worksheets: If your summary is on a 'Yesterday's Results' tab, simply add the data sheet name to the reference, like =INDEX(Data!3:3, COUNTA(Data!3:3)).

Effortlessly Manage Dynamic Data with WPS Spreadsheet

WPS Spreadsheet provides full, built-in support for advanced functions like INDEX, MATCH, and COUNTA, making it incredibly easy to build automated daily summaries and extract the latest row values without hassle.

  1. 1. Open your dataset: Launch WPS Spreadsheet and open the file containing your daily results.
  2. 2. Navigate to the summary tab: Switch to the worksheet where you want to display the last three values.
  3. 3. Apply dynamic functions: Use the =INDEX() and =COUNTA() combination to automatically fetch the end-of-row values without manual updates.
  4. 4. Save your work: Save your file seamlessly in .xlsx format to retain full formula compatibility with other spreadsheet software.
100% compatible with Microsoft Excel formulas and .xlsx filesEasily link data across multiple summary worksheetsFree, lightweight, and fast performance on large datasetsIntuitive interface for managing dynamic ranges effortlessly
microsoft office alternative - wps office

Frequently Asked Questions

Can I use the OFFSET function instead of INDEX?

Yes, you can use a formula like =OFFSET(A3, 0, COUNTA(3:3)-1) to find the last value. However, OFFSET is a 'volatile' function, meaning it recalculates every time any change is made to the worksheet, which can slow down large files. INDEX is generally preferred for performance.

What if there are blank cells scattered in my daily results row?

If there are blank cells, COUNTA will return an inaccurate count, and INDEX will pull from the wrong column. To find the true last non-blank value in a row with gaps, use the LOOKUP function: =LOOKUP(2,1/(3:3<>""),3:3).

How can I automatically pull the column headers corresponding to the last three values?

You can use the exact same INDEX and COUNTA logic, but change the first argument to point to your header row. For example, =INDEX(1:1, COUNTA(3:3)) will return the header from Row 1 that corresponds to the last data entry in Row 3.