Hi! 1. Create a example spreadsheet like the file attachment; 2. select cells; 3. apply the subtotals (Data menu > Subtotals), choosing: Group by: Code Calculate subtotals for: Price Use function: Average 4. click OK. The subtotals will be apply to the cells. Then, after this, return to Data > Subtotals to delete the subtotals: 1. go to Data > Subtotals; 2. click Delete The cells will be return to the original structure. Now, create a new subtotals with a diferent function (Sum instead of Average). 1. go to Data > Subtotals; 2. apply the subtotals simply confirm standard options (without any click in the options): Group by: Code Calculate subtotals for: Price Use function: Sum 3. click OK. The subtotals will be apply. However, the function wich will be used is Average, not Sum. It´s a bug or my mistake? Thanks!
Created attachment 39885 [details] Subtotals problem - modify function
Reproduced. I'll take this.
I looked into this, and turns out that the dialog is not entirely wrong. When launching the dialog after removing the subtotal, it restores the previous selection and checks "Price" *but* the selection remains on "Code". Since "Code" doesn't specify any function it defaults to the first function "Sum". When you select "Price", the function selection becomes "Average" again. I made changes so that when launching the dialog it selects the first checked item if one or more items are checked. With this change, on the dialog shows "Average" function selected when launching it after removing the subtotal. Hopefully that's less confusing for you.
Hi Kohei! Your solution is fine! Thank you for your fantastic job in LibreOffice.