poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Suma G Shanthappa" <suma.shantha...@cgi.com>
Subject Re: Memo: RE: How to get the value of a formula cell?
Date Wed, 17 Dec 2003 08:49:40 GMT
If the data is written and saved in Excel only, then you can get the 
value of formula cell also. Just get the formula cell and use
cell.getNumericCellValue() this should give you the value of the 
formula cell also.

Hope this helps you.


----- Original Message -----
From: alex.bourne@hsbcam.com
Date: Wednesday, December 17, 2003 2:06 pm
Subject: Memo:  RE: How to get the value of a formula cell?

> 
> 
> 
> 
> Hi,
> 
> I'm having a similar problem. I read Excel 97 spreadsheets that were
> written and saved in Excel itself, but I do not  get the formula 
> values -
> they are always 0.0.
> 
> I'm a little confused by what you say about POI reading formulas. 
> You say
> that POI can only read the formula out, then that if you open and 
> save in
> Excel POI gives the correct result (is that the formula value ??).
> 
> If you could clarify the process by which POI can read a formula 
> value(i.e. the result of the formula not the formula itself) I 
> would be very
> grateful as it will currently save me a lot of work !!
> 
> Regards,
> 
> Alex B.
> 
> 
> 
> 
> Michael Zalewski <zalewski@optonline.net> on 17 Dec 2003 05:32
> 
> Please respond to "POI Users List" <poi-user@jakarta.apache.org>
> 
> To:    POI Users List <poi-user@jakarta.apache.org>
> cc:
> bcc:
> 
> Subject:    RE: How to get the value of a formula cell?
> 
> 
> You can't do that with POI. If the cell contains a formula, you 
> can only
> get
> the formula out.
> 
> You must let Excel do the calculation. Excel does this 
> automatically when
> the spreadsheet is opened. That's why opening and saving with 
> Excel, then
> looking at the cell with POI yields the correct result.
> 
> The idea here is that if you build a spreadsheet, you know what 
> numbers you
> put into C1 and C2, and can easily add them in your program.
> 
> Or, if you are processing an uploaded spreadsheet, you can read 
> the values
> of C1 and C2, then add them in your program.
> 
> POI does not, and perhaps never will, interpret or execute the 
> formulas you
> put into the spreadsheet.
> 
> -----Original Message-----
> From: Suma G Shanthappa [mailto:suma.shanthappa@cgi.com]
> Sent: Tuesday, December 16, 2003 4:16 AM
> To: POI Users List
> Subject: How to get the value of a formula cell?
> 
> 
> I have a sheet with formula for cell C3. formula is sum(c1:c2)
> I insert values to c1 and c2. If I try to get the value of C3 I 
> get 0.0
> How do I get the value of c3 cell? Even if i save all the data and 
> thentry to open the file and try reading the value of c3 cell I 
> get 0.0
> But if I do save as and save the file with a diff name and try to read
> the value of c3 cell, I get the correct value?
> 
> Any Idea how to retrieve the value of a formula cell from the same 
> fileto which the data is stored to?
> 
> Thanks
> Suma
> 
> 
> -------------------------------------------------------------------
> --
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
> 
> 
> -------------------------------------------------------------------
> --
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
> 
> 
> 
> ******************************************************************
> This message originated from the Internet. Its originator may or
> may not be who they claim to be and the information contained in
> the message and any attachments may or may not be accurate.
> ******************************************************************
> 
> 
> 
> 
> 
> 
> 
> 
> _____________________________________________________
> 
> This transmission has been issued by a member of the HSBC Group 
> ("HSBC") for the information of the addressee only and should not 
> be 
> reproduced and / or distributed to any other person. Each page 
> attached hereto must be read in conjunction with any disclaimer 
> which 
> forms part of it. This transmission is neither an offer nor the 
> solicitation 
> of an offer to sell or purchase any investment. Its contents are 
> based 
> on information obtained from sources believed to be reliable but 
> HSBC 
> makes no representation and accepts no responsibility or liability 
> as to 
> its completeness or accuracy.
> 
> 
> -------------------------------------------------------------------
> --
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


Mime
View raw message