Stoaty said:
Stoaty needs help with an annoying problem in the Battery Aging Model spreadsheet from someone who knows OpenOffice (or other spreadsheets in general). I have not been able to get around the problem that End of Life calculations (EOL years, EOL miles and remaining service life) do not update properly after making a change in one of the parameters. Requires a workaround to either press Control-Shift-F9 (recalculate all formulas in spreadsheet) or enter the changed parameter a second time (with exact same value). Since Autocalculate is on, formulas should be recalculated correctly without this workaround. Any experts out there with ideas about what might be causing this problem or how to work around it without the above kludges?
I found a rather kludgey solution. On the prediction sheet, take the formula in cell Q7 and copy the text of the formula by highlighting it in the formula bar. Hit escape. Then select cell Q3, click in the formula bar and paste the formula. This should end up with the exact same formula in Q3 that was in Q7. (it should still reference cell F13 for example.) Now the new formula will not update properly but the one in Q7 will work. If you can't get this to work, let me know and I will make the modification and email you the spreadsheet.
That was NOT the first thing I tried. It looks like a bug in OpenOffice to me, but I could not find any reference to such a bug via Google. Below is more detail on what I did for anyone still interested.
I opened Stoaty's spreadsheet in OpenOffice and confirmed the problem occurs as he explained. I then had OpenOffice save it in Excel format and opened it with Excel. It worked properly there. So, one solution was to use Excel.
I went back to OpenOffice and studied the problem. The root cause is that cell Q7 (End of Life Years) on the prediction tab does not update. It uses VLOOKUP with a reference to a table on the end of life tab. I checked that that table updates like it should. It does. It acts like the VLOOKUP in cell Q7 does not know it changed.
I then tried a number of fixes. Short story: none of them worked until I got to the one above.
Long story: I changed the table by hand. Cell Q7 updated properly. I modified cell Q7, adding references to user input cells or to cells in the end of life table. I then checked the response to changes in the input cell. Q7 would update properly with regard to the extra arithmetic I added, but still did not properly pick up the new value for VLOOKUP.
I then tried just copying the formula as described in my first paragraph giving the fix. I saved it to the right of the table on the end of life tab (updating the reference to cell F13 to come from the prediction tab). It worked properly! I then tried it in cell Q10 on the prediction sheet. It still updated properly! I tried deleting the cells Q7-Q9 so my new formula would be in the right place. Broken again! I finally realized that it must be the first one that doesn't get updated and put the formula in cell Q3.