-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Description
It seems excelize evaluates all function arguments before calling a function, which doesn't work well with LOOKUP (HLOOKUP, VLOOKUP ...) functions, especially if table range is large.
E.g. =VLOOKUP(C1, A:XFD, 2) will try to calculate all the cells in the table, instead of just lazily calculating cells in A column, and then calculate a corresponding single cell from B column.
Steps to reproduce the issue
-
Add this simple table to the project
vlookup.xlsx -
Run this code
package main
import (
"fmt"
"github.com/xuri/excelize/v2"
)
func unwrap[T any](v T, err error) T {
if err != nil {
panic(err)
}
return v
}
func main() {
file := unwrap(excelize.OpenFile("vlookup.xlsx"))
val := unwrap(file.CalcCellValue("Sheet1", "C2"))
fmt.Println(val)
}Describe the results you received
It takes ages to calculate this field value.
Describe the results you expected
It should be instant to calculate this cell value.
Go version
1.23.4
Excelize version or commit ID
2.9.0
Environment
Windows 11Validations
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- The provided reproduction is a minimal reproducible example of the bug.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request