ASF Bugzilla – Attachment 37689 Details for
Bug 65059
wrong evaluation of SUMPRODUCT when nested SUMIFS use ranges
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
test case for reproduction
SumproductSumifsWrongEvalutationTest.java (text/plain), 1.77 KB, created by
gerard.duong
on 2021-01-05 11:07:52 UTC
(
hide
)
Description:
test case for reproduction
Filename:
MIME Type:
Creator:
gerard.duong
Created:
2021-01-05 11:07:52 UTC
Size:
1.77 KB
patch
obsolete
>import org.apache.poi.ss.usermodel.Cell; >import org.apache.poi.ss.usermodel.FormulaEvaluator; >import org.apache.poi.ss.usermodel.Row; >import org.apache.poi.ss.usermodel.Sheet; >import org.apache.poi.xssf.usermodel.XSSFWorkbook; >import org.apache.poi.xssf.usermodel.XSSFWorkbookFactory; >import org.junit.jupiter.api.Test; > >import static org.assertj.core.api.Assertions.assertThat; > >class SumproductSumifsWrongEvalutationTest { > > @Test > void testFormulaEvaluateAll() { > XSSFWorkbook workbook = XSSFWorkbookFactory.createWorkbook(); > > FormulaEvaluator formulaEvaluator = workbook.getCreationHelper().createFormulaEvaluator(); > String sheetName = "Sheet1"; > Sheet sheet = workbook.createSheet(sheetName); > > > Row row1 = sheet.createRow(0); > Row row2 = sheet.createRow(1); > Row row3 = sheet.createRow(2); > > > Cell cellB1 = row1.createCell(1); > Cell cellB2 = row2.createCell(1); > Cell cellB3 = row3.createCell(1); > > Cell cellC1 = row1.createCell(2); > Cell cellC2 = row2.createCell(2); > Cell cellC3 = row3.createCell(2); > > Cell cellD1 = row1.createCell(3); > Cell cellD2 = row2.createCell(3); > Cell cellD3 = row3.createCell(3); > > Cell cellA1 = row1.createCell(0); > > > cellB1.setCellValue(1); > cellB2.setCellValue(2); > cellB3.setCellValue(3); > > cellC1.setCellValue(1); > cellC2.setCellValue(1); > cellC3.setCellValue(1); > > cellD1.setCellValue(1); > cellD2.setCellValue(1); > cellD3.setCellValue(1); > > cellA1.setCellFormula("SUMPRODUCT(SUMIFS(B1:B3, C1:C3, D1:D3))"); > formulaEvaluator.evaluateAll(); > assertThat(cellA1.getNumericCellValue()).isEqualTo(18); > } > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 65059
:
37689
|
37690
|
37715