# Formulas are changing unexpectedly. How to debug?

In my Calc-doc, when I update certain data cells, formulas in other places are unexpectedly changed. I can find no relationship between the data updates and the changing formulas. (EDIT1: I'm not editing formulas, I'm entering data.)

EDIT2: I am adding a lot more detail at the bottom of my question.

This problem started after I added some formulas with INDIRECT and OFFSET. But these formulas do not seem to have any connection or relationship to the cells having the problem. (EDIT: And maybe these new formulas are just a red herring. I mention them only in order to provide all the info I can think of.)

Not all cells change unexpected. Only columns L, M and T show the issue.

EDIT: to be clear, I am not editing any formulas when this strange error happens. All I am doing is entering new data into empty cells on a different sheet. When I come back to Sheet 1, the formulas in certain cells in columns L, M and T (e.g., L6) are now updated to include a reference to the sheet I was editing. But I was not editing those cells in the other sheet (e.g., L6). I was not even editing any formulas at all.

Details of the problem:

Sheet 1, cell L3 has this formula:

=IF(U3>0,(E3+F3+G3+H3+I3+J3+K3+O3)/U3,0)


On Sheet 10 (or about 10 other sheets), if I enter data into cells where there are no formulas, and no references I can find to cell L3 on Sheet 1, the formula above will be changed to:

=IF(U3>0,(sht22.P17+sht22.Q17+sht22.R17+sht22.S17+sht22.T17+sht22.U17+sht22.V17+O3)/U3,0)


I'm having trouble discovering the exact steps to reproduce the problem. The problem happens every single time I edit the Calc-doc. It affects the same cells every time. And I know roughly what causes it. But I don't know the exact editing change that causes the formula to change. How can I go about tracing this or debugging it?

EDIT2:

More details:

• Calc-doc has 37 sheets.
• I only see the problem in sheet 1.
• Furthermore, I only see the problem in cells L3 to L7, M3 to M7, T3 to T7.
• In those cells, the formulas are changed as shown below. The changes happen in response to entering new data into sheets sht14 to sht 34.
• When entering data, I am not moving data or cells and I am not changing formulas.
• I am pasting data from a plain text document and from a new (unsaved) temporary CSV file opened in another Calc window.
• The new data is pasted into the next row available and it usually goes across columns C to AU.
• Tools > Detective > Trace Precendents does not show any precendents other than those expected by the simple formulas (e.g., =IF(U3>0,(E3+F3+G3+H3+I3+J3+K3+O3)/U3,0))
• I ...
edit retag close merge delete

I have never been able to solve this. It remains a perplexing problem.

( 2015-09-22 07:32:27 +0200 )edit

Sort by » oldest newest most voted

Hi

If I met this problem I would check, to be sure, if the relevant cells are considered "related". For each I would do Tools Detective Trace Precedents (& Dependants).

[EDIT]

The tool detects the relations between sheets. The arrows are different, they terminate with a square.

[End of EDIT]

You do not indicate if the document includes macros. If yes, of course I would start by opening the document by disabling them to see if it changes anything.

You assume a bug in Calc. It is always possible but unlikely for this type of problem would be systematic. If I understand you have this problem for this spreadsheet and not all cells. It is therefore possible that there is a problem in this spreadsheet (I've seen a Writer document where the styles subfile was found in the content subfile following a saving problem). Elucidating such problems requires to unzip the file and inspect the xml content, which is not easy ...

A one last assumption could be the system. Restart the computer may solve aberrant behavior.

[EDIT#2]

This type of change could be normal if the modified sheet is used in a scenario. The spreadsheet includes scenarios? You can verify this by displaying the Navigator (sidebar or F5) with the Scenario tool:

HTH - Regards

more

Yes, that helps. I will learn about the Tools > Detective feature. At this moment, I am not sure how to use it. This calc-doc contains no macros. I have restarted my computer and the problem persists. I'm running Kubuntu. Thanks again.

( 2015-07-05 07:54:07 +0200 )edit

It seems that Tools > Detective > Trace Precedents won't help me because it doesn't work across multiple sheets. My problem happens when I'm editing sheet 10, cells in sheet 1 are changed. (BTW, protecting sheet 1 doesn't help.) http://ask.libreoffice.org/en/questio...

( 2015-07-05 07:58:10 +0200 )edit

This tool can help. I saw that your problem was between different sheets. See my edit in my answer.

( 2015-07-05 08:11:41 +0200 )edit

Thanks for your answer. I like this tool. It doesn't show me any problem in this calc-doc, but I was going to upvote your answer anyway. However, I don't have enough karma to upvote. Sorry.

( 2015-07-05 20:55:06 +0200 )edit

Thanks for updating your answer. There are no scenarios in this Calc-doc. I verified that using the method you suggested. Also, I see no problems when using the Detective Trace tools. The strange problem continues.

( 2015-07-06 08:57:40 +0200 )edit

I saw that the document was confidential but could you not anonymize? EditFind & Replace, Search for:[:alpha:], Replace with:x, Other options: check Regular expressions, Search inValues, Click Replace All

( 2015-07-06 09:41:45 +0200 )edit

Upgrading to LO 5.0 seems to have resolved this for me. However, at least on Kubuntu 12.04, LO 5.0 seems very rough. Font display is horrible (at least on my machine). Anyway, I am thrilled that this bug has gone away and I hope it is permanently gone. :-)

more

Seems as if you have selected both sheets when you enter the formula, in that case it's inserted in all selected sheets at the same time.

more

That's not the case. I'll edit my question to make it more clear. Thank you.

( 2015-07-04 02:23:38 +0200 )edit

Can then please upload a minimal sample file where to reproduce the issue, with a step by step explanation?

( 2015-07-04 10:26:02 +0200 )edit

Unfortunately, no. My question is "how to figure out how to reproduce it?" If I could produce a minimal sample where the issue is reproduced, I'll be able to solve it myself. I have a programming background. And unfortunately, I cannot even upload the actual spreadsheet as it is a client confidential financial doc. The more I see this problem in action, the more convinced I am that I have stumbled upon a Calc bug.

( 2015-07-04 19:58:33 +0200 )edit

While press [Ctrl] click on a couple of sheet tabs, both are selected, what you write in one of them is also write in the other.

( 2015-07-04 23:04:33 +0200 )edit

This is not an issue of having more than one sheet tab selected. You can rest your mind about that. That is not the problem here. Thanks.

( 2015-07-04 23:39:08 +0200 )edit

Perhaps resetting the User profile

( 2015-07-05 02:00:02 +0200 )edit