[R] Reading Excel Formulas as values

David L Carlson dcarlson at tamu.edu
Wed May 16 16:36:03 CEST 2012


I can't replicate your problem. I created a spreadsheet in Excel 2007
consisting of three columns.  Numbers from 1 - 15, rand(), and the sum of
the first two columns. Using all the defaults with read.xlsx() (package:
xlsx), I get the values of each column and using keepFormulas=TRUE, I get
the formulas as factors. I don't get any NA's. I can also place a formula on
the second sheet that accesses data from the first sheet without any
problems. I haven't tried, Excel 2010. 

Could your formulas be accessing data from another spreadsheet?

----------------------------------------------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352

> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Mike Smith
> Sent: Tuesday, May 15, 2012 3:11 PM
> To: r-help at r-project.org
> Subject: [R] Reading Excel Formulas as values
> 
> When I read excel files using the read.xlsx() command any cells that
> have
> formulas in them come up as NA.
> 
> Is there a way to read just the numeric value of the cell without using
> the
> "paste value" command in Excel?  I need to read in hundreds of Excel
> spreadsheets and compile them into one large super spreadsheet
> automatically.  Hence the reason I cannot reformat each sheet manually.
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list