title: Why won't this formula calculate unless i double click a cell?
body: <p>See this <a href="https://ufile.io/h24b0" rel="nofollow noreferrer">.xlsx</a> file. No macros, of course!</p>
  
  <p>When you open the file, you will see the following cells:</p>
  
  <pre><code>[Series     ]
  [10         ]
  [20         ]
  [30         ]
  [           ]
  [           ]
  [=SUM(B3:B7)]
  </code></pre>
  
  <p>The sum does not calculate unless you double click, and then press enter, in one of the bottom three cells (eg two blank, =SUM(B3:B7))</p>
  
  <hr>
  
  <p>Weirder still, once you 'kicked the formula into life' if you save the workbook and reopen it, it behaves fine.</p>
  
  <p>I've tried changing the extension to .zip, and playing around with Xml to see if I could identify the changes made by saving it after it's started working, but I could only see that a version number had changed.</p>
  
  <p>We. Ird.</p>
  
  <hr>
  
  <p>Also, I tried saving this in an earlier Excel format, and the problem remained.</p>
  
  <hr>
  
  <p>I just want to reiterate - the attached spreadsheet is a .xlsx file, and therefore does not have any macros! There really is no other way of explaining this problem without the attached spreadsheet. Hopefully, by putting 50 points of reputation on the line, someone will trust that I'm not a script kiddie and have a look!</p>
  
  <hr>
  
  <p>I created the file using EPPlus, and the following C# code:</p>
  
  <pre><code>    public void Generate(string outputPath)
      {
          using (FileStream fsTemplate = new FileStream(TemplatePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
          {
              using (FileStream fsReport = new FileStream(outputPath, FileMode.Create, FileAccess.ReadWrite, FileShare.None))
              {
                  using (ExcelPackage ep = new ExcelPackage(fsReport, fsTemplate))
                  {
                      using (ExcelWorksheet ws = ep.Workbook.Worksheets[TemplateSheetName])
                      {
                          //
                          int iHeadingsRow = 2;
                          int dataRowIndex = iHeadingsRow + 1;
                          //
                          List&lt;decimal&gt; list = new List&lt;decimal&gt;() { 10, 20, 30 };
                          //
                          foreach (var number in list)
                          {
                              ws.Cells[dataRowIndex, 2].Value = list[dataRowIndex - iHeadingsRow - 1];
                              //
                              ws.InsertRow(dataRowIndex + 1, 1, iHeadingsRow + 1);
                              //
                              dataRowIndex++;
                          }
                          //
                          ep.Save();
                      }
                  }
              }
          }
      }
  </code></pre>
  
  <p>I would like to emphasise that this is not an EPPlus issue! This is a common problem with Excel opening a valid workbook, and refusing to calculate a formula. Formatting the cells as numeric makes no difference. I have been using EPPlus to create working Excel files for months, and I have not installed any updates to EPPlus, so it must be problem with Excel, right?!</p>
  
  <p>The solution must lie in the difference between the original file, and the version that has been kicked into life and then saved. I just can't seem to pinpoint exactly what that difference is...</p>
  
  <hr>
  
  <p>The =SUM(B3:B7) is already present in the template file, along with the text 'Series'. The code only adds the {10,20,30} items into the spreadsheet.</p>