Error 504 persisting

I’m using Linux mint 22.3 and libreoffice version is LibreOffice 26.2.5.2 620(Build:2).
Because of the complexity of the file, the error persists even if I hit hard calculate. The formulas are ok.
The only way to resolve the issue temporarily is to rewrite the formula for any of the columns by double-clicking the bottom-right corner of the cell, but it works only for 1 row, which means i need to do it about 360 times every time i open the file.
I’m pretty sure the formulas are not wrong because the first few rows are ok by default.
How can explain it so that you can understand my issue? For now I can make some pictures:
This is when i open the file:


This is after i enter some data:

And this is after i rewrite some formula on a whole column by clicking on the right bottom corner of the cell. It solves the next row.

What can I do to solve this?
Thank you.

Error Codes in LibreOffice Calc?

I already know what the errors mean.
That’s not the problem.

Please upload your .ods type sample file here.

I can’t do that, confidential information. That’s why i posted the photos.
It’s something weird about the changes.

Ola @emy1, analisei seu arquivo, e notei a interdependência entre as planilhas, se um ERRO surge em uma células e ela for fonte de informação para outras, surgira ERROS em cadeia. Tem que descobrir qual é este ERRO inicial.
Tem como informar quais são a(s) principais planilhas fonte(s)?

=======================
Hi @emy1, I analyzed your file and noticed the interdependence between the spreadsheets. If an ERROR occurs in one cell and it is a source of information for others, a chain of ERRORS will appear. You need to find out what this initial ERROR is.
Could you tell me which are the main source spreadsheet(s)?

1 Like

One of many places where you have errors is in the cell (or column) $Total.T3:

=SUMIFS($AC.$B3:$QX3;$AC.$B$1:$QX$1;T$1)


In that SUMIFS(), you have the first 2 arguments using a range of 1 row x 465 columns (each), but the third argument is just one cell. You are trying to compare the (1 x 465) range $AC.$B$1:$QX$1 against one cell T$1, additionally with a mix of relative/absolute references that is very possibly inadequate.


It is also possible that you are using the wrong function in that cell.


That error is carried over to a long chain of dependencies.


That cell “$Total.T3” is only one of several other places with real errors.


Any other behavior that you described, such as extending the first row formula further down, are irrelevant until you actually correct all the formulas that are the initial source of the multiple chains of errors.

1 Like

@schiavinatto
The main sheets are Pondere and Bonus, these contain all the rules.

@ady
The arguments for sumifs are sum range, range 1, criteria 1; so no error here.

Does using Detective help?

I tried, it didn’t help.
What i tried and worked is delete all the input data, and all the errors vanished. I’m pretty sure i am careful when inserting those numbers, so i think is should be a problem from how the program manages the data.

Hi @emy1, please review the formula in this cell AC.RK2

Select the cell, press F2, and activate the Function Wizard.

I have discovered that if I change the orders of sheets, which means to put the main one at the beginning and then those that depend on the precedent ones, more rows are without errors.
The problem is from the program.

To be clear, the following comments apply to the file you posted in comment 7. The file you posted in comment 15 has similar issues, but you messed it up even further by introducing a circular reference.


In $AC.RK2 (that is worksheet AC, cell RK2), the second (inner) XLOOKUP is incorrect. If the references and the syntax of that inner xlookup were to be correct, then that part of the formula should had been an array formula. Alternatively, the arguments for that function are inadequate. Whether that is the correction needed for this cell / column – I doubt it – I don’t really know, because I don’t know (nor care) what exactly you are trying to retrieve / achieve with that formula.


Whatever you are trying to achieve – please do not explain it – I would suggest for you to review all your xlookup functions, because they are involved in many of the initial errors that trigger chains of errors in your sample file.


Additionally, you seem to be using xlookup to search for labels, but they do not match – you are using different labels than what you are searching for – so errors are unavoidable even when the formulas and the data were to be correct (which anyway ATM they don’t seem to be).

Ola @emy1, tentei com a ajuda do ChatGPT, nem ele consegui determinar a fonte inicial do ERRO. A minha sugestão, dolorosa, e manter as Planilhas: Pondere; Cla; Panou e Bonus, que não tem ERROS, e refazer todas as demais, e prestando atenção quando o primeiro ERRO surgir, já solucionar.


Hi @emy1, I tried using ChatGPT, but even it couldn’t determine the initial source of the ERROR. My painful suggestion is to keep the spreadsheets: Pondere; Cla; Panou and Bonus, which have no ERRORS, and redo all the others, paying attention to when the first ERROR appears, and solve it immediately.

Will it help if this error would be reported to libreoffice as bug?

No, it won’t. You have no clear steps to reproduce, nor a clear repeatable specific bug to report. The only thing that you have is a file that contains multiple chains of errors, which you claim are not your fault.


Again, your xlookup functions are failing. One of those is failing because the result of the function is expected to be an array (in that particular case, according to the arguments you used), but the formula is not set as an array. Thus, the result is an error, which triggers a long chain of additional errors in other dependent formulas. An alternative would be that you are using inadequate arguments, or an inadequate function.


The suggestion for you is to review your formulas, perhaps redoing the failing worksheets from scratch, anew, with simpler logical steps, in order to identify the exact step that produces the first problem / error.

1 Like

Can you specify which xlookup function?

@ady
It doesn’t solve the main problem, which is, the first few rows are solved with the functions as they are, but the next rows are not solved, the error is based on the same functions.

We already did, twice.


In $AC.RK2 (and in RJ2, and who knows in how many other cells / columns), the second (or inner) xlookup uses a “Result array” argument that is a range ($Bonus.$D$199:$E$206), which means that either:

  • you are using the wrong function; or,
  • you are using wrong arguments; or,
  • the function needs to be an array formula.

Quoting from Help content:

If Result Array is a range of cells, the XLOOKUP function must be entered as an array formula.

Considering that the xlookup function in question is not located on a column by itself (as it is an inner function which takes its result as an argument for a second xlookup), my guess is that whatever you are trying to retrieve with that inner xlookup is not what you are really obtaining.


So, for row 2, you at least get some numeric result for the outer xlookup, which you see displayed on the cell ($AC.RK2). The first row (row 2) gets you “some” numeric result, despite having the “#VALUE!” error as result of the inner xlookup. But then, for the next rows, you actually get an error, because the outer xlookup doesn’t know what to do with the failing result from the inner xlookup.


As for the confusing results when you change the position of some worksheets, that is probably because you are using relative references to some other worksheet instead of using absolute references (or that is my first guess). Having a reference such as “nameofworksheet.cell” is a relative reference to the worksheet, whereas “$nameofworksheet.cell” (note the “$”) is a generic example of an absolute reference to the worksheet (with a relative reference to the cell within it).


Moreover, using worksheet names such as “AC” would not be generally recommended, since it is too similar to referencing an entire column. Similar cases are “AL”, “Med”, “Pe”, “AL”, “Pro”, “Cla”, even when some of those use a mix of upper and lower case letters.


The sample file you presented here seems to have multiple relations between its worksheets. I do not know whether these relations can be simplified. Perhaps you could try (temporarily) using simpler layouts and separating the steps into multiple columns / rows, instead of using multiple levels of inner/outer functions within one cell / column. Some of the intermediate results might not be really needed (such as displaying a column that you do not really need), but once you have the actual results matching your expectations, then you can try to combine those simpler steps into more complex formulas, thus eliminating the intermediate steps. Using intermediate steps is not always possible, but it is a valid technique in order to find out what exactly does not match your expectations.


To be clear, a bug in some function is still a (hypothetical, generic) possibility; it just happens that your sample file does not help and does not prove such potential bug. It is more likely that you are misusing some function(s).


As already suggested, you need to completely review (or start from scratch, anew) the whole logic of your formulas, each step at a time, in order to find out where exactly you are misusing a function or an argument; meaning what exactly you actually obtain against what was that you were expecting to obtain. One row is not enough, as demonstrated by your own sample file.

Another humble sincere suggestion; you might want to spend some time reading and learning about the functions that you are using.

1 Like

I’ve already changed those 2 formulas with index+match combination and added the $ before sheet names, and changed the sheet names as you said, and added a new column to take the rating at the end of the last day and put it at the beginning of the new day, and it worked. Before, the formulas were taking the rating at the end of the last day, that’s why i was getting the 522 error. It shouldn’t give this error, but calc isn’t capable of doing it.
I’ve also changed a few functions from xlookup to index+match, not because they were bad, but because i’ve read somewhere that the latter is faster on excel.
I still get one error on one of the sheets, namely 522, which makes no sense. A picture:
error 522
It’s just a simple sum, where both cells have a number, not an error.
If i apply the formula again for the whole column, the error disappears completely from the whole sheet.