[Dropped] Sum all numbers above current cell

Discuss the spreadsheet application
Locked
Digika
Posts: 31
Joined: Mon May 17, 2021 3:25 pm

[Dropped] Sum all numbers above current cell

Post by Digika »

 Edit: Split from [Solved] How to sum all numbers above current cell because that topic is solved and cannot accept a new question from a new person. You should open your own topic, Digika, for this subject since your situation "more dynamic with dynamic offset" is different.
-- MrProgrammer, forum moderator 
How can I make it more dynamic with dynamic offset? Say I have column CI30-CI40 and CI41 will be SUM, however, some rows might be deleted and now I have CI30-CI-37, and CI38 is the sum - so basically what I want is to calculate how many row are there from [$current-CI30] and then do the sum. So i need to go up from dynamic cell to fixed cell and summarize.
OpenOffice 3 on Windows 10/7
User avatar
Villeroy
Volunteer
Posts: 31363
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] How to sum all numbers above current cell

Post by Villeroy »

Digika wrote:ay I have column CI30-CI40 and CI41 will be SUM, however, some rows might be deleted and now I have CI30-CI-37, a
If you actually delete the row, the formula adjusts automatically.
Same when you actually insert rows.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
Lupp
Volunteer
Posts: 3756
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: [Solved] How to sum all numbers above current cell

Post by Lupp »

If you use dedicated columns where only entries of the same "kind" (semantically defined group here) are entered (or calculated from entries in different columns), you should simply place totals or related calculations ABOVE the data.
Thats better for the view (fix the rows), and much better for the structure.
If you calculate =SUM(CJ$2:CJ$1048576) many possible problems simply vanish, and the internal working of Calc will apply very efficient means to avoid "millions of unnecessary calculations". Simply try it. (Calc isn't a maternal-school exercise-book.)

Of course, there are also ways to calculate the parameters for OFFSET(), and there are settings to allow for automatic expansion of ranges (under a certain condition), But why do it the complicated way?

Intermediary partial evaluation (partial sums, averages,... "subtotals") breaking the semantic unity is evil paper-think.
On Windows 10: LibreOffice 25.8.4 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
Digika
Posts: 31
Joined: Mon May 17, 2021 3:25 pm

Re: [Solved] How to sum all numbers above current cell

Post by Digika »

Villeroy wrote:
Digika wrote:ay I have column CI30-CI40 and CI41 will be SUM, however, some rows might be deleted and now I have CI30-CI-37, a
If you actually delete the row, the formula adjusts automatically.
Same when you actually insert rows.
It does not, I've just tested. Also, your formula starts from top, I need reverse order, from bottom of $CURRENT_CELL_FORUMLA_IS_IN to specific top fixed.
OpenOffice 3 on Windows 10/7
User avatar
robleyd
Moderator
Posts: 5509
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: [Solved] How to sum all numbers above current cell

Post by robleyd »

You may need to make a change in your settings. Tools | Options | OpenOffice Calc | General
oo_expand_refs.png
Slackware 15 (current) 64 bit
Apache OpenOffice 4.1.16
LibreOffice 26.2.3.2; SlackBuild for 26.2.3 by Eric Hameleers
---------------
I hate this damn computer, I wish that I could sell it.
It won't do what I want it to, Only what I tell it.
User avatar
Villeroy
Volunteer
Posts: 31363
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] How to sum all numbers above current cell

Post by Villeroy »

robleyd wrote:You may need to make a change in your settings. Tools | Options | OpenOffice Calc | General
Without that option being checked:
Insertion at the top row moves the reference down. SUM(A1:A9) becomes SUM(A2:A10).
Insertion below the top row expands the reference. SUM(A1:A9) becomes SUM(A1:A10).
Insertion below the referenced range does nothing. SUM(A1:A9) remains the same when the insertion is in row #10.

With that option being checked:
Insertion anywhere within the referenced range or directly below expands the reference. SUM(A1:A9) becomes SUM(A1:A10). Likewise with columns.
This can be annoying in some cases which is why we can turn it off. You want this setting for list keeping in a spreadsheet.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Locked