Add the First and Last Values in a Dynamic Excel Column
Question details
Add the first and last numeric values in an Excel column whose length changes as data is added.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A column grows as new rows are added, and the user wants the sum to update automatically.
- Observed behavior
- The formula should add the first data value to the value in the current last row.
For the first formula, place a header in C1 and numeric values in consecutive cells starting at C2, with no blank cells or unrelated data below them. Enter the formula outside column C to avoid a circular reference.
Use INDEX and COUNTA for a Continuous Excel Column
Use this formula when column C has a header in C1 and no gaps in its data.
Click an empty cell outside column C, such as E2.
Type =SUM(C2,INDEX(C:C,COUNTA(C:C))) and press Enter.
Enter a number in the next empty cell in column C. The result cell will update to add C2 and the new last value.

Use Structured References for an Excel Table Column
Use this option when the values are in an Excel table and you want the formula to follow the table column as it grows.
Add First and Last Column Values in WPS Spreadsheets
Use INDEX and COUNTA in WPS Spreadsheets to sum the first value and the current last value in a continuous column.
- 1. Open the workbook: Open WPS Spreadsheets and select Open to choose your Excel workbook.
- 2. Check the column: Confirm that C1 contains a header and that numeric values begin in C2 without blank cells or unrelated entries below them.
- 3. Enter the formula: Click an empty cell outside column C, type =SUM(C2,INDEX(C:C,COUNTA(C:C))), and press Enter.
- 4. Test the result: Enter a new number in the next empty cell in column C and check that the result updates.

Frequently Asked Questions
Why does the COUNTA formula return the wrong value?
COUNTA counts nonempty cells, so it matches the last row number only under the stated layout: a header in C1, continuous data from C2, and no unrelated entries below. Check column C for blanks or extra content.
Can I use INDIRECT instead of INDEX?
Yes. With the same continuous-column layout, =SUM(C2,INDIRECT("C"&COUNTA(C:C))) can work. INDEX is generally preferable because INDIRECT is volatile and can trigger additional recalculations.
What happens if the column contains only one value?
The first and last data cells are both C2, so the formula adds that value twice.
Will the Excel table formula include the totals row?
No. A structured reference such as Table1[Values] refers to the table column's data rows, not its header or totals row.




