How can I automate adding subtotals in the next column

Hello,
I am trying to add subtotals in the next column. The data is a little large spanning across 10k rows. How can I automate?
Pankaj

as i think you don’t ask for C100: ‘=SUM(B10;B20;B30;B100)’ it would be helpful to give a more detailed description of your case …

To add a subtotal at each row: If data are in A2:A10000, type in B2 =A2, and in B3 =B2+A3, then copy B3 until B10000.

See sample file: subtotal in next column.ods. Colored cells have formulas.

Edit your question if you need to add more information (Add Answer is reserved for solutions).

Check the mark (Correct answer mark) to the left of the answer that solves your question.