Sum Function in Excel


#1

I am having a strange occurence from a spreadsheet that was built with aspose.
I have a column that has cells formatted as numbers. After opening spreadsheet I try to
sum the cells with no result. I type in exactly the same numbers that are in the cells produced by aspose and the sum function display the correct value.


#2

Hi Bob,

That’s really a strange problem. Could you please send me your problem file?


#3

How do I send you a file?


#4

You can email it to me at excel@aspose.com.


#5

Hi Bob,

I got your file and I found the data in all cells are strings.

If you want to put a numberic data to the result file, please don’t convert it to string.

For example,

double doubleValue = 12.34;
cell.PutValue(doubleValue);

//Do not convert them to string
cell.PutValue(doubleValue.ToString()); //If you convert it to string, numeric functions in formula will not take effect


#6

Laurence,

I thought that might be the case. My problem is that I am bringing in text print files.
It would be nice if we could switch a column to double, etc for an entire column. Your thoughts?

Thanks,
Bob


#7

Bob,

You can use Double.Parse(string) to convert your string to number. That’s easier and more controllable.