This project has moved. For the latest updates, please go here.

(SOLVED) Cell formula issue: Sumproduct

Aug 26, 2012 at 1:12 PM
Edited Aug 26, 2012 at 1:25 PM

When I enter the following formula as a formula, the workbook opens up with an error that the document has unreadable content, it has been recovered with some cells missing. When I look in the Excel error log, it just mentions unreadable cells removed.
If I enter it as a Value, and manually hit enter, it works with no issues.
(in Powershell)
Am I doing something wrong? Can I circumvent this?


$ws.Cells.item(($r),13).Formula = "Sumproduct($Jan_I;$Jan_M)/Sum($Jan_I)" #errors

$ws.Cells.item(($r),13).Value = "=Sumproduct($Jan_I;$Jan_M)/Sum($Jan_I)" #comes up as text, I hit enter manually, and it works.

I will try this tip to see if the formula somehow changes:

The easiest way to check a format or a formula is to create an Excel file --> Do the formatting / Add the formulas --> Save it as XLSX ---> Rename the file *.zip. Extract the file and have a look at the number formats in the \xl\styles.xml file and formulas in \xl\worksheets\sheet#.xml.