Skip to content
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

writeFormula adding an "@" symbol between formulas #519

Open
wwyws0000 opened this issue Oct 15, 2020 · 2 comments
Open

writeFormula adding an "@" symbol between formulas #519

wwyws0000 opened this issue Oct 15, 2020 · 2 comments

Comments

@wwyws0000
Copy link

Hi, I'm trying to write a formula to the spreadsheet that takes the sum of absolute values of a range (say, cell A2:A11).

I.e, the desired formula is SUM(ABS(A2:A11))

Expected Behavior

Using writeFormula(), I expected the resulting formula to be exactly that

Actual Behavior

However, the actual formula in the resulting Excel spreadsheet is =SUM(ABS(@ A2:A10))

There's a "@" that came out of nowhere and it's messing up the calculation

This is likely due to interactions with Excel's spill/dynamic array features.

Steps to Reproduce the Problem

wb <- createWorkbook()
addWorksheet(wb,'Test')
testMat <- matrix(rep(10,10),10,1)
writeData(wb,'Test',testMat)

testFormula <- 'SUM(ABS(A2:A11))'
writeFormula(wb,'Test',testFormula,startCol = 1,startRow = 13)

saveWorkbook(wb,'test.xlsx',overwrite = T)

sessionInfo()

R version 3.6.2 (2019-12-12)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)

openxlsx_4.2.2

Excel: Microsoft Office 365 ProPlus

@ycphs
Copy link
Contributor

ycphs commented Oct 27, 2020

Could you please create this also at ycphs/openxlsx?

I am maintaining the active fork of the package.

@wwyws0000
Copy link
Author

Yep I submitted another post there. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants