excelize icon indicating copy to clipboard operation
excelize copied to clipboard

Is there any possible GetCellFormula faster?

Open ShowerBandV opened this issue 7 months ago • 2 comments

Description A sheet which has 4600 rows and 55 cols, and some cols have formulas,I want to get them,it seems no problem but the time cost is very large,I want to know whether excelize can solve this.

here is demo code and file

func TestGetFormulas(t *testing.T) {
	file, err := excelize.OpenFile("4600Formulas.xlsx")
	if err != nil {
		panic(err)
	}
	begin := time.Now()
	for col := 0; col < 55; col++ {
		for row := 0; row < 4600; row++ {
			axis := AxisEncode(col, row)
			_, err := file.GetCellFormula("Sheet1", axis)
			if err != nil {
				panic(err)
			}
		}
	}
	fmt.Printf("GetCellFormula time cost:%dms", time.Since(begin).Milliseconds())
}

4600Formulas.xlsx

ShowerBandV avatar Jul 22 '24 08:07 ShowerBandV