[Solved] Autosum acting weird

Discuss the spreadsheet application
Post Reply
canadiandevil
Posts: 1
Joined: Sat Jul 22, 2023 1:46 pm

[Solved] Autosum acting weird

Post 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 1237 times
Last edited by MrProgrammer on Mon Jul 31, 2023 5:18 pm, edited 1 time in total.
Reason: Tagged ✓ [Solved] -- MrProgrammer, forum moderator
OpenOffice 4.1 on Windows 11
User avatar
RoryOF
Moderator
Posts: 35097
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Autosum acting weird

Post 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.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.5 LTS
User avatar
Zizi64
Volunteer
Posts: 11494
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Autosum acting weird

Post 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...
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
MrProgrammer
Moderator
Posts: 5328
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Autosum acting weird

Post 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 1139 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.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7.6, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Autosum acting weird

Post 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.
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
Post Reply