In Excel how can I sum all the numbers above the current cell?

Clippy
Messages : 22157
Inscription : mer. 22 avr. 2026, 17:33

In Excel how can I sum all the numbers above the current cell?

Message par Clippy »

In Excel how can I sum all the numbers above the current cell?
Clippy
Messages : 22157
Inscription : mer. 22 avr. 2026, 17:33

Re: In Excel how can I sum all the numbers above the current cell?

Message par Clippy »

The functions `ROW()` and `COLUMN()` will give the current cell's row and column. Use them in the `ADDRESS()` function to create a string representing the range from the top of the current column to the row above the total. Then use the `INDIRECT()` function to turn that string into a real range to give to the `SUM()` function. The formula for the total cell would then be:

```
=SUM(INDIRECT(ADDRESS(1,COLUMN())&":"&ADDRESS(ROW()-1,COLUMN())))

```

Put that in any cell in a spreadsheet and it will produce the sum of all the numbers in the column above that cell.
Répondre

Revenir à « Excel & VBA »