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

Add support for table referencing #2062

Open
IvanHristov98 opened this issue Jan 3, 2025 · 1 comment
Open

Add support for table referencing #2062

IvanHristov98 opened this issue Jan 3, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@IvanHristov98
Copy link

Description

The library currently doesn't support table referencing. E.g. a formula like =INDEX(MyTable[Column1], 2) isn't calculated correctly. It returns an invalid reference error. It is interesting though that the library already has a notion of tables.

The goal of this issue is to add support for table referencing.

Steps to reproduce the issue:

  1. Create a table with f.AddTable("Sheet1", &Table{Range: "A2:C5", Name: "MyTable"}).
  2. Add a cell formula f.SetCellFormula("Sheet1", "A1", "=INDEX(MyTable[Column1], 2)")
  3. Set the value of cell A3 to be "Foo" with f.SetCellValue("Sheet1", "A3", "Foo")
  4. Calculate the cell value f.CalcCellValue("Sheet1", "A1") and receive an error invalid reference.

Describe the results you received:

An error called invalid reference.

Describe the results you expected:

To receive "Foo" after calculating the value of "A1".

Output of go version:

go version go1.23.2 darwin/arm64

Excelize version or commit ID:

caf22e4974afa377baeac21803de3923fd78e627

Environment details (OS, Microsoft Excel™ version, physical, etc.):

Apple M3 Pro, macOS 14.4 (23E214)

Received the result with an xlsx file generated by gsheet.

Notes

I think I already implemented the feature. There should be a reference PR with the proposed change.

@IvanHristov98
Copy link
Author

It could also be treated as a bug. I'm not really sure.

@xuri xuri added the enhancement New feature or request label Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants