formula evaluation in cells when import excel sheet in R using read_excel
up vote
0
down vote
favorite
I want to import some excel files to R using read_excel
(measured values by an instrument, with some parameters calculated using other measured values, so it has lots of formulas in some of the cells), I want to import all the files once, but when I import the files, I find the cells with formula are 0, they are not evaluated.
the basic code are:
library(readxl)
readxl_6800 <- function(path, name_rows = 42, data_rows = 43)
data_name <- read_excel(path, range= cell_rows(name_rows))
df <- read_excel(path, skip = data_rows, col_names = FALSE)
colnames(df) <- colnames((data_name))
return (df)
df
the results are:
# A tibble: 360 x 10
obs time elapsed date TIME E A Ca Ci Pci
<dbl> <dbl> <dbl> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 1 1500971222. 0 20170725 16:27~ 1.50e9 0 0 0 0 0
3 3 1500971224. 2 20170725 16:27~ 1.50e9 0 0 0 0 0
4 4 1500971224. 3 20170725 16:27~ 1.50e9 0 0 0 0 0
5 5 1500971226. 4 20170725 16:27~ 1.50e9 0 0 0 0 0
where the zero values should be values larger than zero.
the sample excel can be download from:
example file
how can I import the excel in this form with the formula evaluated? any suggestions?
I do not want to rewrite these formulas in R, as it will add lots of codes in R, it is the last choice.
r
add a comment |
up vote
0
down vote
favorite
I want to import some excel files to R using read_excel
(measured values by an instrument, with some parameters calculated using other measured values, so it has lots of formulas in some of the cells), I want to import all the files once, but when I import the files, I find the cells with formula are 0, they are not evaluated.
the basic code are:
library(readxl)
readxl_6800 <- function(path, name_rows = 42, data_rows = 43)
data_name <- read_excel(path, range= cell_rows(name_rows))
df <- read_excel(path, skip = data_rows, col_names = FALSE)
colnames(df) <- colnames((data_name))
return (df)
df
the results are:
# A tibble: 360 x 10
obs time elapsed date TIME E A Ca Ci Pci
<dbl> <dbl> <dbl> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 1 1500971222. 0 20170725 16:27~ 1.50e9 0 0 0 0 0
3 3 1500971224. 2 20170725 16:27~ 1.50e9 0 0 0 0 0
4 4 1500971224. 3 20170725 16:27~ 1.50e9 0 0 0 0 0
5 5 1500971226. 4 20170725 16:27~ 1.50e9 0 0 0 0 0
where the zero values should be values larger than zero.
the sample excel can be download from:
example file
how can I import the excel in this form with the formula evaluated? any suggestions?
I do not want to rewrite these formulas in R, as it will add lots of codes in R, it is the last choice.
r
It's highly unlikely folks are going to create an account on a service to download a file. Also, Microsoft Excel generally stores the computed value of the cells along with the formula. Find the equivalent of "Calculate Sheet" in your version of Excel and use it and then re-save the files.read_excel()
picks up the calculated values. Thexlsx
package seems to have an option to refresh formulas on ingestion but I've not used it for that so cannot confirm.
– hrbrmstr
Nov 11 at 14:06
I am sorry for the links need to register, I have changed it to dropbox, and the reason I do not want to use excel to resave is that I want to write a batch program, and then people can import lots of files by the program once to save time, as the data files can be hundreds.
– jd zhu
Nov 11 at 14:37
I just wonder why the formulas can not be evalute in such a excel files with this form, as I know the formluas in a file with rectangular data form can be evlauted without any problem
– jd zhu
Nov 11 at 14:38
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I want to import some excel files to R using read_excel
(measured values by an instrument, with some parameters calculated using other measured values, so it has lots of formulas in some of the cells), I want to import all the files once, but when I import the files, I find the cells with formula are 0, they are not evaluated.
the basic code are:
library(readxl)
readxl_6800 <- function(path, name_rows = 42, data_rows = 43)
data_name <- read_excel(path, range= cell_rows(name_rows))
df <- read_excel(path, skip = data_rows, col_names = FALSE)
colnames(df) <- colnames((data_name))
return (df)
df
the results are:
# A tibble: 360 x 10
obs time elapsed date TIME E A Ca Ci Pci
<dbl> <dbl> <dbl> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 1 1500971222. 0 20170725 16:27~ 1.50e9 0 0 0 0 0
3 3 1500971224. 2 20170725 16:27~ 1.50e9 0 0 0 0 0
4 4 1500971224. 3 20170725 16:27~ 1.50e9 0 0 0 0 0
5 5 1500971226. 4 20170725 16:27~ 1.50e9 0 0 0 0 0
where the zero values should be values larger than zero.
the sample excel can be download from:
example file
how can I import the excel in this form with the formula evaluated? any suggestions?
I do not want to rewrite these formulas in R, as it will add lots of codes in R, it is the last choice.
r
I want to import some excel files to R using read_excel
(measured values by an instrument, with some parameters calculated using other measured values, so it has lots of formulas in some of the cells), I want to import all the files once, but when I import the files, I find the cells with formula are 0, they are not evaluated.
the basic code are:
library(readxl)
readxl_6800 <- function(path, name_rows = 42, data_rows = 43)
data_name <- read_excel(path, range= cell_rows(name_rows))
df <- read_excel(path, skip = data_rows, col_names = FALSE)
colnames(df) <- colnames((data_name))
return (df)
df
the results are:
# A tibble: 360 x 10
obs time elapsed date TIME E A Ca Ci Pci
<dbl> <dbl> <dbl> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 1 1500971222. 0 20170725 16:27~ 1.50e9 0 0 0 0 0
3 3 1500971224. 2 20170725 16:27~ 1.50e9 0 0 0 0 0
4 4 1500971224. 3 20170725 16:27~ 1.50e9 0 0 0 0 0
5 5 1500971226. 4 20170725 16:27~ 1.50e9 0 0 0 0 0
where the zero values should be values larger than zero.
the sample excel can be download from:
example file
how can I import the excel in this form with the formula evaluated? any suggestions?
I do not want to rewrite these formulas in R, as it will add lots of codes in R, it is the last choice.
r
r
edited Nov 11 at 14:34
asked Nov 11 at 13:48
jd zhu
11
11
It's highly unlikely folks are going to create an account on a service to download a file. Also, Microsoft Excel generally stores the computed value of the cells along with the formula. Find the equivalent of "Calculate Sheet" in your version of Excel and use it and then re-save the files.read_excel()
picks up the calculated values. Thexlsx
package seems to have an option to refresh formulas on ingestion but I've not used it for that so cannot confirm.
– hrbrmstr
Nov 11 at 14:06
I am sorry for the links need to register, I have changed it to dropbox, and the reason I do not want to use excel to resave is that I want to write a batch program, and then people can import lots of files by the program once to save time, as the data files can be hundreds.
– jd zhu
Nov 11 at 14:37
I just wonder why the formulas can not be evalute in such a excel files with this form, as I know the formluas in a file with rectangular data form can be evlauted without any problem
– jd zhu
Nov 11 at 14:38
add a comment |
It's highly unlikely folks are going to create an account on a service to download a file. Also, Microsoft Excel generally stores the computed value of the cells along with the formula. Find the equivalent of "Calculate Sheet" in your version of Excel and use it and then re-save the files.read_excel()
picks up the calculated values. Thexlsx
package seems to have an option to refresh formulas on ingestion but I've not used it for that so cannot confirm.
– hrbrmstr
Nov 11 at 14:06
I am sorry for the links need to register, I have changed it to dropbox, and the reason I do not want to use excel to resave is that I want to write a batch program, and then people can import lots of files by the program once to save time, as the data files can be hundreds.
– jd zhu
Nov 11 at 14:37
I just wonder why the formulas can not be evalute in such a excel files with this form, as I know the formluas in a file with rectangular data form can be evlauted without any problem
– jd zhu
Nov 11 at 14:38
It's highly unlikely folks are going to create an account on a service to download a file. Also, Microsoft Excel generally stores the computed value of the cells along with the formula. Find the equivalent of "Calculate Sheet" in your version of Excel and use it and then re-save the files.
read_excel()
picks up the calculated values. The xlsx
package seems to have an option to refresh formulas on ingestion but I've not used it for that so cannot confirm.– hrbrmstr
Nov 11 at 14:06
It's highly unlikely folks are going to create an account on a service to download a file. Also, Microsoft Excel generally stores the computed value of the cells along with the formula. Find the equivalent of "Calculate Sheet" in your version of Excel and use it and then re-save the files.
read_excel()
picks up the calculated values. The xlsx
package seems to have an option to refresh formulas on ingestion but I've not used it for that so cannot confirm.– hrbrmstr
Nov 11 at 14:06
I am sorry for the links need to register, I have changed it to dropbox, and the reason I do not want to use excel to resave is that I want to write a batch program, and then people can import lots of files by the program once to save time, as the data files can be hundreds.
– jd zhu
Nov 11 at 14:37
I am sorry for the links need to register, I have changed it to dropbox, and the reason I do not want to use excel to resave is that I want to write a batch program, and then people can import lots of files by the program once to save time, as the data files can be hundreds.
– jd zhu
Nov 11 at 14:37
I just wonder why the formulas can not be evalute in such a excel files with this form, as I know the formluas in a file with rectangular data form can be evlauted without any problem
– jd zhu
Nov 11 at 14:38
I just wonder why the formulas can not be evalute in such a excel files with this form, as I know the formluas in a file with rectangular data form can be evlauted without any problem
– jd zhu
Nov 11 at 14:38
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53249388%2fformula-evaluation-in-cells-when-import-excel-sheet-in-r-using-read-excel%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
It's highly unlikely folks are going to create an account on a service to download a file. Also, Microsoft Excel generally stores the computed value of the cells along with the formula. Find the equivalent of "Calculate Sheet" in your version of Excel and use it and then re-save the files.
read_excel()
picks up the calculated values. Thexlsx
package seems to have an option to refresh formulas on ingestion but I've not used it for that so cannot confirm.– hrbrmstr
Nov 11 at 14:06
I am sorry for the links need to register, I have changed it to dropbox, and the reason I do not want to use excel to resave is that I want to write a batch program, and then people can import lots of files by the program once to save time, as the data files can be hundreds.
– jd zhu
Nov 11 at 14:37
I just wonder why the formulas can not be evalute in such a excel files with this form, as I know the formluas in a file with rectangular data form can be evlauted without any problem
– jd zhu
Nov 11 at 14:38