use of org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator in project poi by apache.
the class TestAddress method testAddress.
public void testAddress() {
HSSFWorkbook wb = new HSSFWorkbook();
HSSFCell cell = wb.createSheet().createRow(0).createCell(0);
HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb);
String formulaText = "ADDRESS(1,2)";
confirmResult(fe, cell, formulaText, "$B$1");
// with explicitly empty third parameter
formulaText = "ADDRESS(1,2,)";
confirmResult(fe, cell, formulaText, "$B$1");
formulaText = "ADDRESS(22,44)";
confirmResult(fe, cell, formulaText, "$AR$22");
formulaText = "ADDRESS(1,1)";
confirmResult(fe, cell, formulaText, "$A$1");
formulaText = "ADDRESS(1,128)";
confirmResult(fe, cell, formulaText, "$DX$1");
formulaText = "ADDRESS(1,512)";
confirmResult(fe, cell, formulaText, "$SR$1");
formulaText = "ADDRESS(1,1000)";
confirmResult(fe, cell, formulaText, "$ALL$1");
formulaText = "ADDRESS(1,10000)";
confirmResult(fe, cell, formulaText, "$NTP$1");
formulaText = "ADDRESS(2,3)";
confirmResult(fe, cell, formulaText, "$C$2");
formulaText = "ADDRESS(2,3,2)";
confirmResult(fe, cell, formulaText, "C$2");
formulaText = "ADDRESS(2,3,2,,\"EXCEL SHEET\")";
confirmResult(fe, cell, formulaText, "'EXCEL SHEET'!C$2");
formulaText = "ADDRESS(2,3,3,TRUE,\"[Book1]Sheet1\")";
confirmResult(fe, cell, formulaText, "'[Book1]Sheet1'!$C2");
}
use of org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator in project poi by apache.
the class TestCalendarFieldFunction method setUp.
@Override
public void setUp() {
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("new sheet");
cell11 = sheet.createRow(0).createCell(0);
cell11.setCellType(CellType.FORMULA);
evaluator = new HSSFFormulaEvaluator(wb);
}
Aggregations