Page 1 of 1

[Solved] Autosum acting weird

Posted: Sat Jul 22, 2023 1:51 pm
by canadiandevil
Hi folks!

I realise autosum will only work on numbers (not text) - but shouldn't it be able to sum the results of functions?

In the attached picture, A and B are numbers, while X is their autosum
If I now add value C, and try to get an autosum for X and C, the X value is ignored.

This only happens if X is a sum of a range. If X is a sum function of a single cell, then it works ok.
Any advice? Thanks :)
Screenshot 2023-07-22 123941.png
Screenshot 2023-07-22 123941.png (39.97 KiB) Viewed 1236 times

Re: Autosum acting weird

Posted: Sat Jul 22, 2023 1:58 pm
by RoryOF
Check that the autosum parameters are correct. In my test, autosum initially was only =Sum(b4). I had to enter the B3 parameter, viz =sum(B3:B4).
How is autosum to know whether that parameter should be B1, or B3? You have to tell it. If you highlight B3 and B4, then choose the autosum in B5, it will enter the correct parameters.

Re: Autosum acting weird

Posted: Sat Jul 22, 2023 2:49 pm
by Zizi64
In the attached picture, A and B are numbers, while X is their autosum
If I now add value C, and try to get an autosum for X and C, the X value is ignored.
Please upload a real, ODF type sample file here...

Re: Autosum acting weird

Posted: Sat Jul 22, 2023 5:27 pm
by MrProgrammer
Hi, and welcome to the forum.
canadiandevil wrote: Sat Jul 22, 2023 1:51 pm I realise autosum will only work on numbers (not text) - but shouldn't it be able to sum the results of functions?
You can find answers to many questions using Help. This is faster than asking questions here. In this case, both Autosum button and sum icon in the Help index will direct you to the explanation below.
Help → Index → sum icon wrote:Inserts the sum of a cell range into the current cell, or inserts sum values into selected cells. Click in a cell, click this icon, and optionally adjust the cell range. Or select some cells into which the sum values will be inserted, then click the icon.

Σ       Sum

OpenOffice automatically suggests a cell range, provided that the spreadsheet contains data. If the cell range already contains a sum function, you can combine it with the new one to yield the total sum of the range. If the range contains filters, the Subtotal function is inserted instead of the Sum function. Click the Accept icon (green check mark) to use the formula displayed in the input line.
Based on that explanation, the Autosum suggestion for the summands that you term weird (the cells following the last SUM) seems reasonable to me. If the suggestion isn't what you want, change it before accepting the formula.

If the goal is to create a running total, I think that Autosum may not be a convenient feature to use. Perhaps you should be using filters. Perhaps you should be using a Pivot Table (formerly called Data Pilot) or the Data → Subtotals feature instead of the Σ icon. In the illustation below the rows in bold are created automatically by the feature. I can't tell what you might want until you provide your real spreadsheet.
Created with Data → Subtotals
Created with Data → Subtotals
202307221052.gif (42.22 KiB) Viewed 1138 times

canadiandevil wrote: Sat Jul 22, 2023 1:51 pm If X is a sum function of a single cell, then it works ok.
But then X is not really a sum, it's just a copy of another cell. When D5 contains a number, formula =SUM(D5) has the same value as formula =D5. Read section 9. Using functions and cell ranges in Ten concepts that every Calc user should know.

If you need any additional assistance attach a spreadsheet demonstrating the difficulty (remove confidential information then use Post Reply, not Quick Reply, and don't attach a picture or screen capture instead of the spreadsheet itself). I will not help further unless you attach a spreadsheet and explain your goal. You should explain how you determine which cells are to be summed.

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the Subject field. Select the green checkmark icon at the same time.

Re: Autosum acting weird

Posted: Sun Jul 23, 2023 5:26 pm
by RusselB
Autosum, by default, will not include the results of a previous sum function.
Exactly how it finds the first cell to use for the sum range, I don't know, but I do know that if there is a cell with a SUM function in it, the cell below it will be the first cell that is included in the Autosum.