Function Problems

Add the First and Last Values in a Dynamic Excel Column

Olivia MillerOlivia Miller Dec 2, 2026 869 views

Question details

Add the first and last numeric values in an Excel column whose length changes as data is added.

Add the First and Last Values in a Dynamic Excel Column
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.
Before you start

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.

Solution 1Recommended

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.

1
Select a result cell

Click an empty cell outside column C, such as E2.

2
Enter the formula

Type =SUM(C2,INDEX(C:C,COUNTA(C:C))) and press Enter.

3
Add another value

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 INDEX and COUNTA for a Continuous Excel Column
Keep the column continuous: COUNTA counts nonempty cells rather than finding the last occupied row. Blank cells, a missing header, or unrelated entries below the data can make the formula return the wrong row.
Work with dynamic columns in WPS

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. 1. Open the workbook: Open WPS Spreadsheets and select Open to choose your Excel workbook.
  2. 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. 3. Enter the formula: Click an empty cell outside column C, type =SUM(C2,INDEX(C:C,COUNTA(C:C))), and press Enter.
  4. 4. Test the result: Enter a new number in the next empty cell in column C and check that the result updates.
Update the sum as new values are added to the column.Open and edit Microsoft Excel XLS and XLSX files.Use familiar spreadsheet formulas in a free office suite.
microsoft office alternative - wps office

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.