LibreOffice Calc fetches wrong values ​​between sheets with =SUM()

I recently migrated from Microsoft Office to LibreOffice. Sure there are some differences and there was some learning to do, but overall everything has gone pretty smoothly. With one major exception. Calc.

I use Calc for a lot of everyday things. Among other things, simple accounting. And this is where I ran into problems.

My simple accounting

Each year has its own calculation sheet. Each such sheet is divided into twelve tabs, one tab for each month.

On each tab (month) there are several different accounts. Each account retrieves data from the previous tab’s (month’s) last value (i.e. from the specific cell where the value is found). The formula used for this is the simplest of them all: [=SUM()]. In the same way, each new year’s calculation sheet retrieves its values ​​from the previous year’s last values ​​for the respective account.

When I work in a sheet for a specific year, and things go wrong… :

As long as I don’t make any major changes, everything works as it should.

However, problems can arise when rows are deleted (**Ctrl, -**) in a tab. The tab that follows that tab doesn’t seem to be able to handle that change. That is, the calculation in the immediately following tab retrieves the value from the place that was correct before the rows in the previous tab were deleted.

You discover it quite quickly. It’s easy to fix. But quite annoying (in Excel I never had that problem).

What is worse, however, is what happens when you open spreadsheets from previous years. These spreadsheets were perfectly functional and correct the last time they were used. Everything was as it should be. Each sheet calculated the correct values ​​and the subsequent years retrieved and left their values ​​as they should, up to the last calculation made in the last year’s calculation sheet.

However, for some strange reason, something happens (strange miscalculations) when you reopen the spreadsheets from previous years, which becomes clear when the spreadsheet for the current year is opened. You notice it right away because you know what is correct and especially if you have other, external, sources for certain accounts, such as accounts at your bank to compare with.

What I found was quite strange.

To begin with, I had to go back to the place where the correct values ​​were.

What I then noticed was that the connection between the cell with the correct value and the cell that retrieved its value from that cell was not working correctly:

The value was retrieved from the correct address, i.e. from the correct cell, it was clear and obvious). But the values ​​that were provided were wrong!

For example: the value in cell F30 in the “Dec” tab for the year 2025 is 2900.90. But when that value is retrieved and then displayed in cell F24 in the “Jan” tab for the year 2026, the value is delivered as 435.56.

I double-checked that it was actually the correct path to the cell where the value was to be retrieved. It was the correct address.

Mysterious.

I then deleted the entire path in the cell that was to retrieve the value and entered it again. That is, the exact same path to the same cell.

Now it worked!

Why?

No idea.

In this example, I actually had to go back to spreadsheets for years that I hadn’t had open in a very long time before I could finally find the cell where the error originated.

It also differed between different accounts how far I had to go back. For a certain account I had to go back as far as 2021, for another account it was the sheet for 2023.

After that I was forced to do the same procedure for each year between the months of December and January for each new change from an older year to the next year, all the way up to the most recent year (2026 in this case).

That is, in this case there were no changes whatsoever made to the sheets where the “errors” had their source. The calculation error occurred, although it is hard to believe, actually in LibreOffice Calc.

Since this has happened a number of times, I have some routine in finding and correcting errors, but that is not how it is supposed to work, and it is after all quite tiring – and there are better things to do with my time.

The crucial question, the reason I’m posting this thread, is of course: why is this happening, and what can be done to prevent it from happening over and over again?

Looking forward to hearing from all the knowledgeable Calc-Kings :slightly_smiling_face:

Kind regards
ICIT
:herb::cherry_blossom::herb:

Please upload .ods type sample files here.

1 Like

Thanks for reply Zizi64 :slight_smile:

Regarding the upload. I am a total beginner in LibreOffice.
So here are some follow up questions:

  1. List item What is an “ods.type sample file”?
  2. About the upload: Where is “here” (I don’t see any link or other address)?
  3. When the upload is completed: What do I do with the .ods type sample files (to solve the problem)?

Kind regards
ICIT
:herb::cherry_blossom::herb:

You are using the Libreoffice Calc, and you do not know, what is an .ods file?
The .ods is the native file format of the Libreoffice Calc.
A sample file (or two of them), that contain the problematic formulas.

1 Like

There is an Upload button in the header of the message edit window.

Then we will able to examine it/them: the formulas, references of the sample files.

This makes everything far more complicated than necessary.

As we have nothing to inspect until now it is only guesswork.
But maybe change settingss for recalculation:

Compare also:

The mysterious function of a link can be the following: =DDE(server, file, article, mode).

Thanks for reply koyotak :slight_smile:

So, as just mentioned above: I am a total beginner in LibreOffice.
So if you can translate

=DDE(server, file, article, mode)

to my beginner level I would be very grateful!

Kind regards
ICIT
:herb::cherry_blossom::herb:

But I don’t think we need to use DDE, when a simple =Sheet.A1 should also work.

If we want to compare different years, we need DDE. One sheet per month, one document per year. The usual spreadsheet madness.

Seems I should have read the opening thread more carefully…
But it was also possible to link directly
=‘file:///Users/xxx/Documents/foo.ods’#$‘Sheet1’.A1
as in this question:

(And I suspect @ICIT references xlsx or xls-files…)

1 Like

Allow me to introduce another concept which is compatible with many spreadsheet applications (Excel in particular) and database applications as well.
PivotData.ods (82.7 KB)

  • The first sheet has one flat list with data from all years and months.
  • One header row with filter buttons on top.
  • The filter button for the dates allow you to show data for any year or month with 2 or 3 simple clicks.
  • From row #2 downwards all the data, dates below dates, text below text, numbers below numbers.
  • I sorted the rows in random order before uploading in order to demonstrate that the order of rows does not matter at all. You can filter and sort this source table any way you want. You can insert rows for new data anywhere in that source table.
  • The other 2 sheets contain pivot tables (cross tables with calculated results), derived from the flat data table. Pivot tables allow many aspects of evaluation and easy charting with 2 clicks.

There is not a single formula in the entire document.

1 Like

I apologize for the long delay in responding (due to other matters, I have had no other option than to quickly note that new replies to the thread have been received).

When I now come back to the discussion and see how it has grown with all the replies that have flowed in from all the different people who have put their time and energy into contributing in various ways to find a solution to the question, I am truly moved.

As I should have mentioned in my initial question – and as I mentioned in my previous post, I am a total beginner in LibreOffice.

I should also perhaps mention that my English language skills are at a level where I constantly need to look up a lot of words, and with certain types of sentence structures, misunderstandings or ambiguities can still arise.

If it had been possible to edit my first post, I would have put this information there.

I would also like to point out that my problem occurs in LibreOffice, but not in Excel (which I migrated from). That is, everything in my spreadsheets is identical between both software programs. Every single formula, every single number, etc.

The only formula that has been problematic here is: =SUM(), and it has, in the context of this question, done nothing other than retrieve the value from another cell, and that cell has been a cell from another spreadsheet (in this case a spreadsheet with values ​​from the previous year, which in turn retrieved values ​​from its previous year, etc.).

Furthermore, as I also wrote at the beginning: the problem with the incorrect values ​​disappeared the moment I manually entered the exact same path (the path to the cell from which the value was to be retrieved) that was already there in the problematic cell!

What solved the problem, albeit in a complicated way, was to type in exactly the same thing again by hand. This does not happen in Excel with exactly the same files (spreadsheets).

The question that arises in me is why the error occurs in LibreOffice but not in Excel?

Even if it takes some time, I would be happy to upload one or more .ods example files to this thread, but based on what I have just explained, I wonder to what extent these example files will really provide any answers or clues.

Well,I really am a super beginner, but I’ve reach so far that I know what an .ods file is. It was in the context of “ods.type sample file” that I misunderstood it as being about some special type of .ods file (probably due to my lack of English skills).

When I then read through some of the other answers regarding the code/language I didn’t understand ("=DDE(server, file, article, mode)") and (“DDE”) that came to this thread, I concluded that there were concerns about whether I would be required to upload only one (1) spreadsheet, or several (which I, as mentioned above, have wondered about the necessity of).

In any case, thank you for all the other detailed information on this issue!

When I read through what “Wanderer” writes, I sense what could perhaps be an answer to the question I just asked.

For obvious reasons, I have never used F9 or Ctr-Shift-F9, but I have actually tested the possibility of updating external data on a few occasions (Edit → Links to External Files…). If I remember correctly it worked on one occasion, but not on another. (I always use the latest update of LibreOffice.)

In this particular case, for some unknown reason, I didn’t actually use that option.

As soon as I get a little more air in the schedule, I will test it and see how far I get that way.

I also want to give a little extra thanks to Villeroy for all the work he/she put into this.

For my part, however, this is a premium. I haven’t progressed so far in my spreadsheet usage that I use pivot tables.

I did take a look at the spreadsheet though. What I was particularly impressed with was the absence of formulas, while I didn’t have a clue how this was accomplished.

However, possibly moving this pivot table application to my spreadsheets is not something I am considering. It would mean an enormous amount of work as it involves years of collected information and where each year basically contains a comprehensive annual report which also has other external connections.

So, in conclusion:

If there is really something that suggests that uploading, say, three, .ods example files (they will of course be simplified to a minimum) can provide any clue, I will, as soon as I have a gap in an already overly tight schedule, upload them.

I will also come back with what results the use of the possibility to update external data (Edit → Links to External Files…) can give.

And again – a big, big thank you to everyone who contributed!

Pivot tables are made for absolute beginners and maintaining a single table is by far easier than maintaining many of them. Software is very good at analyzing huge chunks of data.

1 Like

Thank you so much for the generous review of pivot tables (and charts) :slightly_smiling_face:

When I have a little more time, I will definitely take a closer look at these and see how they could become part of my spreadsheet usage.

Kind regards
ICIT
:herb::cherry_blossom::herb: