title: XLSXWriter formula across more than one column
body: <p>I'm trying to apply a simple multiplication formula (B1=B2*B3...C1=C2*C3) for every column in a spreadsheet.</p>
  
  <p>I've reviewed the (fantastic) xlsxwriter documentation, as well as this similar question: <a href="https://stackoverflow.com/questions/39944961/xlsxwriter-apply-formula-across-column-with-dynamic-cell-reference">XLSXWriter Apply Formula Across Column With Dynamic Cell Reference</a>, but I can't get it to work across multiple columns.  Going down a single column is easy using a loop and incrementing the value of the row number, but I'm having trouble applying the same concept across a row (multiple columns).</p>
  
  <p>I'm using <code>xl_rowcol_to_cell()</code> to get the A1 notation of the final cells in the spreadsheet (because it's going to be different every time), but I can't figure out how to plug those variables into a workable formula or array formula.</p>
  
  <pre><code>cell1 = xl_rowcol_to_cell(1, total_columns - 1)
  cell2 = xl_rowcol_to_cell(2, total_columns - 1)
  cell3 = xl_rowcol_to_cell(3, total_columns - 1)
  </code></pre>
  
  <p>I was thinking something like this:</p>
  
  <pre><code>worksheet.write_array_formula('B1:%s', '{=PRODUCT(B2:%s,B3:%s)}' % (cell1, cell2, cell3))
  </code></pre>
  
  <p>But I keep having problems with string formatting, and when I try just plugging in actual values instead of using string formatting I get garbage out of Excel.  </p>
  
  <p>Any help would be appreciated.</p>