Create XLSX and cannot Sum a column

Jun 1, 2012 at 12:08 PM

After I have created the spreadsheet with Closed XML. When I try to sum a column or actually any 2 cells It alway comes up with 0.

For example if Cell A2 has a 2 and Cell B2 has a 4  if I put in a Cell =Sum(a2:b2) it comes back with ZERO

If i do Sum(2,4) it adds 2 and 4 but it will not take a reference to a cell.

What am I doing wrong?




Jun 1, 2012 at 1:50 PM

FAQ: How do I get the result of a formula?

Jun 4, 2012 at 10:20 AM

I mean to say once I have created the Excel file in closedXML and I open it in Excel I cannot sum two columns. I don't mean to say I was using ClosedXML to sum the columns. I have found a work around, If I select the columns or cells I want to add then I use "Data-->Text to columns" (In Excel) I  can then add the colums in Excel (not ClosedXML).

Is there a way to Tell ClosedXML not to do what ever it is doing to make me have to use "Data-->Text to columns" (In Excel)  to add a colums values. Again I am only creating the Excel file in ClosedXML I am doing the Addition in Excel




Jun 4, 2012 at 11:29 AM

I found the problem. I was putting as single quote into the data to indicate that they were text fields.