Template in LO Calc get corupted when inserting it into a workbook.

I have a template in LO Calc which I use to prepare budgets. The functions in the template work correctly until I insert it into a workbook. Then some functions are corrupted, such as totals of columns of “derived” numbers (values calculated from VLOOKUP results) giving # VALUE errors, or some IF formulas not responding. Everything worked fine for months and months- during which time I made repeated tweaks- and apparently messed something up, which I’ve not been able to identify. I was using version 4.5.3, if memory serves, and upgraded to 5.0, and still same problem. Reverting back to 4.5.3 didn’t help. The workbook currently has 18 sheets, of which 13 are based on the template. I’m running Precise Puppy Linux 5.7.1 on a Dell XPS400. My workaround is to just not insert the new budgets into the workbook and leave them as stand-alone files. Thank you very much for your advice,and to the developers and testers for their countless hours and hard work to bring us the suite we have now. (What should I have included besides?)