-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@ is appended to formula at start of cell range #49
Comments
Hi, geebioso. I'm unable to replicate your issue. When running your code, the output is as expected, with no "@". library(openxlsx)
workbook <- openxlsx::createWorkbook()
openxlsx::addWorksheet(workbook, "Sheet1")
openxlsx::writeData(workbook, sheet = "Sheet1", 1:10)
openxlsx::writeFormula(workbook, sheet = "Sheet1", startCol = 2, "AVERAGE(ABS(A1:A10))")
openxlsx::saveWorkbook(workbook, file = "formula.xlsx", overwrite = TRUE) Created on 2020-03-13 by the reprex package (v0.3.0) Session infodevtools::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#> setting value
#> version R version 3.6.3 (2020-02-29)
#> os Ubuntu 19.10
#> system x86_64, linux-gnu
#> ui X11
#> language (EN)
#> collate en_US.UTF-8
#> ctype en_US.UTF-8
#> tz America/New_York
#> date 2020-03-13
#> |
Hey JoshuaSturm, Thanks for checking it out. Looks like this isn't an openxlsx issue, but a Mac issue. I just tested on PC and formula worked. And for folks looking to do this on PC: while the formula worked it didn't give the correct result. Excel on PC (I tested 2016) doesn't support array functions like Mac does. It's better to use "=SUMPRODUCT(ABS(A1:A10)) / ROWS(A1:A10)" rather than "AVERAGE(ABS(A1:A10))". Cheers |
Hey ycphs,
Thanks for continuing to develop openxlsx!
Expected Behavior
use
writeForumla
to write and excel formula taking the average of the absolute value of a range of cells. E.g., write "AVERAGE(ABS(A1:A10))" to cell B1.Actal Behavior
an '@' is appended to the beginning of the cell range. E.g., "AVERAGE(ABS(@A1:A10))"
Steps to Reproduce the Problem
The error appears in cell B1. The formula should say "AVERAGE(ABS(A1:A10))", but says
"AVERAGE(ABS(@A1:A10))"
Thanks for your time!
sessionInfo()
The text was updated successfully, but these errors were encountered: