Automatic formula when add row?

I have a little problem with Calc. What I want is when I add a row, the formula from previous row is automatically applied to the new row.
Let say that I have three rows and three columns. In the third column, I enter formula: =A+B. And then copy that formula for the rest two C column. In the fourth row, I put a total from all numbers in column C. Now I want to add a row on the top of the fourth column, and I want formula for column C (=A+B) automatically applied.
In excel this can be easily done by add an additional row between the total row and those rows above it. And then I just need to add another additional row on top of the total row, and then put numbers on the first empty rows for column A and B, and column C will automatically filled. But it seems that I can’t to this in Calc.
How can I solve this problem?
Thanks.

@ROSt53: I don’t meant that there is a button/ option to add row and have the formula automatically copied. I add the the row by clicking add row button/ from menu, then the formula automatically copied. It just like the link that @mahfiaz gave.

@ROSt53: version 2007. Sorry I can’t attach the file. My karma is only 1 (they need > 3 to allow me to attach the file). But If I’m not wrong this trick works fine in previous version.

@ROSt53: Try to follow this step: (1) make column C is addition from column A and B. (2) fill any number from A1 and B1 until A3 and B3. (3) Copy formula from C1 to C2:C4. (4) Add formula "=sum(C1:C4) at C5. (5) add a row above row 5. (6) try to fill number at A4 and B4. (7) Repeat step 5 and 6 as many as you want.

@uti_nunc - you should now have enough karma. Please try to upload. I will make a test according your description and come back

@ROSt53. Thanks. But, the site disallow me to attach excel file.

This thread discusses the very same thing, the answer claims it works the way that poster wished, but I cannot replicate this in LibreOffice either.

http://www.oooforum.org/forum/viewtopic.phtml?t=35266

Although the link given by @mahfiaz says that in Excel formulas are added automatically when inserting a row in areas with formulas described by @uti_nunc I test made in MSOExcel 2003 / SP2 , which shows that there is no option to add a row and have the formula automatically copied.

In Excel I created the array as described by @uti_nunc , and added rows by

  • clicked in cell &
    —clicked on the icon to insert row
    —used menu insert / row
  • selected the entire row &
    —clicked on the icon to insert row
    —used menu insert / row

I also repeated in Excel the procedure described in @mahfiaz’s link. In my Excel the inserted line is empty and now formula is added automatically.

IMHO such an automated adding of formulas will create problems at other points…e.g. If someone wants to add an empty row to separate calculations.

@uti_nunc - Which steps did you do in Excel to get the desired result you described? And which Excel version did you use?

@uti_nunc - Reading your comment in your questions, I feel it must be a question of Excel version. Which version are you using?

Could you possibly upload a sample file created in Excel?