@@ -2655,14 +2655,14 @@ func TestCalcCellValue(t *testing.T) {
26552655 "=AVEDEV(\" \" )" : "#VALUE!" ,
26562656 "=AVEDEV(1,\" \" )" : "#VALUE!" ,
26572657 // AVERAGE
2658- "=AVERAGE(H1)" : "AVERAGE divide by zero " ,
2658+ "=AVERAGE(H1)" : "#DIV/0! " ,
26592659 // AVERAGEA
2660- "=AVERAGEA(H1)" : "AVERAGEA divide by zero " ,
2660+ "=AVERAGEA(H1)" : "#DIV/0! " ,
26612661 // AVERAGEIF
26622662 "=AVERAGEIF()" : "AVERAGEIF requires at least 2 arguments" ,
2663- "=AVERAGEIF(H1,\" \" )" : "AVERAGEIF divide by zero " ,
2664- "=AVERAGEIF(D1:D3,\" Month\" ,D1:D3)" : "AVERAGEIF divide by zero " ,
2665- "=AVERAGEIF(C1:C3,\" Month\" ,D1:D3)" : "AVERAGEIF divide by zero " ,
2663+ "=AVERAGEIF(H1,\" \" )" : "#DIV/0! " ,
2664+ "=AVERAGEIF(D1:D3,\" Month\" ,D1:D3)" : "#DIV/0! " ,
2665+ "=AVERAGEIF(C1:C3,\" Month\" ,D1:D3)" : "#DIV/0! " ,
26662666 // BETA.DIST
26672667 "=BETA.DIST()" : "BETA.DIST requires at least 4 arguments" ,
26682668 "=BETA.DIST(0.4,4,5,TRUE,0,1,0)" : "BETA.DIST requires at most 6 arguments" ,
@@ -4603,7 +4603,7 @@ func TestCalcCOVAR(t *testing.T) {
46034603 }
46044604}
46054605
4606- func TestCalcDCOUNTandDCOUNTAandDMAXandDMIN (t * testing.T ) {
4606+ func TestCalcDatabase (t * testing.T ) {
46074607 cellData := [][]interface {}{
46084608 {"Tree" , "Height" , "Age" , "Yield" , "Profit" , "Height" },
46094609 {"=Apple" , ">1000%" , nil , nil , nil , "<16" },
@@ -4621,20 +4621,21 @@ func TestCalcDCOUNTandDCOUNTAandDMAXandDMIN(t *testing.T) {
46214621 assert .NoError (t , f .SetCellFormula ("Sheet1" , "A3" , "=\" =Pear\" " ))
46224622 assert .NoError (t , f .SetCellFormula ("Sheet1" , "C8" , "=NA()" ))
46234623 formulaList := map [string ]string {
4624- "=DCOUNT(A4:E10,\" Age\" ,A1:F2)" : "1" ,
4625- "=DCOUNT(A4:E10,,A1:F2)" : "2" ,
4626- "=DCOUNT(A4:E10,\" Profit\" ,A1:F2)" : "2" ,
4627- "=DCOUNT(A4:E10,\" Tree\" ,A1:F2)" : "0" ,
4628- "=DCOUNT(A4:E10,\" Age\" ,A2:F3)" : "0" ,
4629- "=DCOUNTA(A4:E10,\" Age\" ,A1:F2)" : "1" ,
4630- "=DCOUNTA(A4:E10,,A1:F2)" : "2" ,
4631- "=DCOUNTA(A4:E10,\" Profit\" ,A1:F2)" : "2" ,
4632- "=DCOUNTA(A4:E10,\" Tree\" ,A1:F2)" : "2" ,
4633- "=DCOUNTA(A4:E10,\" Age\" ,A2:F3)" : "0" ,
4634- "=DMAX(A4:E10,\" Tree\" ,A1:F3)" : "0" ,
4635- "=DMAX(A4:E10,\" Profit\" ,A1:F3)" : "96" ,
4636- "=DMIN(A4:E10,\" Tree\" ,A1:F3)" : "0" ,
4637- "=DMIN(A4:E10,\" Profit\" ,A1:F3)" : "45" ,
4624+ "=DCOUNT(A4:E10,\" Age\" ,A1:F2)" : "1" ,
4625+ "=DCOUNT(A4:E10,,A1:F2)" : "2" ,
4626+ "=DCOUNT(A4:E10,\" Profit\" ,A1:F2)" : "2" ,
4627+ "=DCOUNT(A4:E10,\" Tree\" ,A1:F2)" : "0" ,
4628+ "=DCOUNT(A4:E10,\" Age\" ,A2:F3)" : "0" ,
4629+ "=DCOUNTA(A4:E10,\" Age\" ,A1:F2)" : "1" ,
4630+ "=DCOUNTA(A4:E10,,A1:F2)" : "2" ,
4631+ "=DCOUNTA(A4:E10,\" Profit\" ,A1:F2)" : "2" ,
4632+ "=DCOUNTA(A4:E10,\" Tree\" ,A1:F2)" : "2" ,
4633+ "=DCOUNTA(A4:E10,\" Age\" ,A2:F3)" : "0" ,
4634+ "=DMAX(A4:E10,\" Tree\" ,A1:F3)" : "0" ,
4635+ "=DMAX(A4:E10,\" Profit\" ,A1:F3)" : "96" ,
4636+ "=DMIN(A4:E10,\" Tree\" ,A1:F3)" : "0" ,
4637+ "=DMIN(A4:E10,\" Profit\" ,A1:F3)" : "45" ,
4638+ "=DAVERAGE(A4:E10,\" Profit\" ,A1:F3)" : "73.25" ,
46384639 }
46394640 for formula , expected := range formulaList {
46404641 assert .NoError (t , f .SetCellFormula ("Sheet1" , "A11" , formula ))
@@ -4659,6 +4660,9 @@ func TestCalcDCOUNTandDCOUNTAandDMAXandDMIN(t *testing.T) {
46594660 "=DMAX(A4:E10,\" x\" ,A1:F3)" : "#VALUE!" ,
46604661 "=DMIN()" : "DMIN requires 3 arguments" ,
46614662 "=DMIN(A4:E10,\" x\" ,A1:F3)" : "#VALUE!" ,
4663+ "=DAVERAGE()" : "DAVERAGE requires 3 arguments" ,
4664+ "=DAVERAGE(A4:E10,\" x\" ,A1:F3)" : "#VALUE!" ,
4665+ "=DAVERAGE(A4:E10,\" Tree\" ,A1:F3)" : "#DIV/0!" ,
46624666 }
46634667 for formula , expected := range calcError {
46644668 assert .NoError (t , f .SetCellFormula ("Sheet1" , "A11" , formula ))
0 commit comments