Preferences > Calc > Formula Set Detailed Calculation Settings = Custom working on a existing XLS file and save the file. Close and re-open the file. Revert to = Default and save the file. Trying to set back = Custom won't trigger the file change. Re-open Preferences > Calc > Formula and Detailed Calculation Settings = Default. In a existing ODF file Detailed Calculation Settings = Custom. Don't know why, not set by me. Set to = Default triggers file change. Save the file. Close and re-open the file. Preferences > Calc > Formula and Detailed Calculation Settings = Custom again. In a newly-created ODF file Detailed Calculation Settings = Default. Save and re-open the file. Set = Custom. Re-open Preferences > Calc > and Formula Detailed Calculation Settings = Default looks un-changed. Save the file with CTRL-S. Close and re-open the file. Now Preferences > Calc > Formula Detailed and Calculation Settings = Custom looks updated.
@wu ming : the Preferences > Calc > Formula setting should apply to LibreOffice as a whole, unless you click on the Details button and the click on the option to apply to current document. Is this what you did with your first example involving the Excel file ? The reason I ask is that the default setting for me in my master build 5.2 alpha is for customised calculation. If I then reset the formula calculation to Default, without having changed anything else in the sheet, I can save the file to xlsx and get the usual question about whether I really want to export to xlsx blabla because I might lose formatting etc. When I re-open the file, and return to Preferences again, I see that Customised is again selected, instead of Default, so in that sense, I can reproduce your findings (only the other way around).
@alex: in Detailed Calculation Settings : Details don't see anything to set as per-file configuration. I can read - convert from text to num - treat empty string as zero - reference syntax for string ref - use OpenCL for a subset of operations (default ON) - minimum data for OpenCL use - subset of OpCodes (with a list) and a button to test OpenCL. Works. The XLS was not converted from ODF.
Just to clarify - saving advanced calculation settings in an XLSX file is rather a niche feature =) I'll set this to enhancement; thanks for reporting.