-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
How to get the computed value #65
Comments
No you can't, this library doesn't implement the formula calculation engine. |
Got it. |
Is it a laborious functional? Is it difficult to implement it? Maybe it can be ported from tealeg/xlsx? |
Implementing a formula engine, we need to create parser and calculation engine to come with over hundreds of formula, named references, volatile functions, dynamic references and many more. It would require a very large number of test cases would be several months of work involved. That's an interesting job and I will consider adding support for this feature later. I'll certainly accept that patch if somebody did that. The library tealeg/xlsx doesn't implement it currently. |
Yes, indeed, this is not the easiest task. In tealeg/xlsx it is possible to read the already calculated value. Example:
Output: There is no recalculation here, but the calculated value can be read. Maybe it's easier to implement? Such a functional would also be useful. |
Excel will storage last computed value with tag |
Ok. So, I missed something. But... Here's the script I'm interested in: 1.xlsx => A1 = 1, A2 = 2, A3 = SUM(A1: A2)
Output: Is it possible to somehow get 102? That is, I just want Excel to recalculate the values I've entered and saved. Maybe I want too much, because it's just an xml file... |
Call function |
Well, all right. Life goes on. Thank you very much for the clarification! |
Here is a tested workaround how to invoke MS Excel recalculation engine from MS Power Shell. Create poweshell script with a name excel.ps1:
In your go program create a new function
And in your go program, where you are saving the excel file, use the folowing code to save it and to force external recalculation:
Enjoy. Simplification of this code is welcomed. |
…LOOR.MATH, FLOOR.PRECISE, INT, ISO.CEILING, LN, LOG, LOG10, MDETERM
…OOR, FLOOR.MATH, FLOOR.PRECISE, INT, ISO.CEILING, LN, LOG, LOG10, MDETERM
…, RANDBETWEEN, ROMAN
…uired format default
…formula functions - ref qax-os#65, new formula functions: DCOUNT and DCOUNTA - support percentile symbol in condition criteria expression - this update dependencies module
…, DVAR, and DVARP
- Support set and get font color with indexed color - New export variable `IndexedColorMapping` - Fix getting incorrect page margin settings when the margin is 0 - Update unit tests and comments typo fixes - ref qax-os#65, new formula functions: AGGREGATE and SUBTOTAL
- Add support for 10 formula functions: ARRAYTOTEXT, FORECAST, FORECAST.LINEAR, FREQUENCY, INTERCEPT, ODDFYIELD, ODDLPRICE, ODDLYIELD, PROB and VALUETOTEXT - Update unit tests
- Correction cell type when formatting date type cell value - Add check for MID and MIDB formula functions num_chars arguments, prevent panic on specifying a negative number - Ref qax-os#65, add support for 2 formula functions: SEARCH and SEARCHB - Fix a v2.8.0 regression bug, error on set print area and print titles with built-in special defined name - Add new exported function `GetPivotTables` for get pivot tables - Add a new `Name` field in the `PivotTableOptions` to support specify pivot table name - Using relative cell reference in the pivot table docs and unit tests - Support adding slicer content type part internally - Add new exported source relationship and namespace `NameSpaceSpreadSheetXR10`, `ContentTypeSlicer`, `ContentTypeSlicerCache`, and `SourceRelationshipSlicer` - Add new exported extended URI `ExtURIPivotCacheDefinition` - Fix formula argument wildcard match issues - Update GitHub Actions configuration, test on Go 1.21.x with 1.21.1 and later - Avoid corrupted workbooks generated by improving compatibility with internally indexed color styles
- Improve compatibility for absolute path drawing part - Fix incorrect table ID generated in the workbook which contains single table cells - Fix missing relationship parts in the content types in some cases - Upgrade number format parser to fix missing literal tokens in some cases - Update built-in zh-cn and zh-tw language number format - Ref qax-os#65, init new formula function: TEXT - Remove duplicate style-related variables - Update the unit tests
…ula not support yet)
How to get the computed value of a cell, after applying the formula, which is written into the cell? For example, A1 = 1, A2 = 2, A3 = SUM (A1: A2)
xlsx.GetCellValue("Sheet1", "A3")
-> ""Can I extract 3?
The text was updated successfully, but these errors were encountered: