-
-
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
CalcCellValue returns incorrect results in some case #1807
Comments
Thanks for your issue. Which version of the Excelize library are you using? Could you follow the issue template and show us a complete, standalone example program or reproducible demo? |
感谢回复🙏! Steps to reproduce the issue:
func getExcel() (*excelize.File, error) {
f, err := excelize.OpenFile("demo.xlsx")
if err != nil {
fmt.Println(err)
return nil, err
}
defer func() {
if err := f.Close(); err != nil {
fmt.Println(err)
}
}()
return f, nil
}
func testCalc(_ context.Context) error {
f, err := getExcel()
if err != nil {
return err
}
const (
sheet1 = "Sheet1"
sheet2 = "Sheet2"
)
// 打印公式
formula, err1 := f.GetCellFormula(sheet2, "B1")
fmt.Printf("公式:%s 错误:%s \n", formula, err1)
// 计算公式
calVal, err2 := f.CalcCellValue(sheet2, "B1")
fmt.Printf("公式结果:%s 错误: %s \n", calVal, err2)
return nil
} Describe the results you received:
Describe the results you expected: Output of
Excelize version or commit ID:
Environment details (OS, Microsoft Excel™ version, physical, etc.): |
@xuri 完整的复现路径如上所示🙏🙏 |
…ell (#1810) Co-authored-by: zhualong <[email protected]>
Thanks for your feedback. This issue has been fixed. Please upgrade to the master branch code by |
感谢🙏 |
我的Excel文件有两个工作表,分别为:
Sheet2中有一列的值使用VLOOKUP计算,公式内容为:VLOOKUP(C4,'Sheet1'!A$2:B$200,2,0),目的是为了在Sheet1的 A$2:B$200范围内中查找Sheet2 C4单元格值,并返回Sheet1对应第二列的值
但是实际上CalcCellValue返回了 空字符串 且没有任何报错,想请教下这个问题该如何解决
The text was updated successfully, but these errors were encountered: