-
Notifications
You must be signed in to change notification settings - Fork 277
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
After adding rows to ExcelTable, the filled column formula loses the properties of the array formula #1638
Comments
This is indeed a bug. Looks like Epplus does not extend the array formula correctly when the rows are added. The '@' is likely added because it assumes a different kind of formula where the '@' is always the first token e.g. |
Epplus does not support array formulas in tables fully. We are considering adding it as a feature/bugfix but it requires considerable overhaul/overhead to ensure we do it right. Meanwhile, as you've already discovered in #1635 there is a workaround. As long as your file already contains the CalculatedColumnFormula with array="1" You can apply the workaround like this:
|
Yes, I am also now manually adding all the cells in the current column myself, creating an array formula instead of the one EPPLUS automatically created for me. it's really a problem, the formula returns only one cell, how to tell if this formula is an array formula is a big problem. However, I think there is one small improvement that can be made. If the file already marks the CalculatedColumnFormula definition as an array formula, consider using CreateArrayFormula to generate the formula content of the cell when EPPLUS's formula is filled. It's not a normal formula. In my scenario, in fact, I created my template file in the Excel environment, and used the function of importing and exporting data on EPPLUS. When importing data, I adjusted the lines of ExcelTable according to the size of the data, and the formula automatically helped me fill it with the FillDown effect similar to VBA. |
testExcelTable.xlsx
EPPlus usage
Noncommercial use
Environment
Windows
Epplus version
7.4
Spreadsheet application
Excel365
Description
I used the following code to add a new line after opening Excel, but the array formula lost its function and became a formula with an @ sign in front of it
it need to refill the value of the cell depending on whether the calculatedColumnFormula is an array, take the label of the array with it
The text was updated successfully, but these errors were encountered: