You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2011/04/08 17:25:23 UTC
DO NOT REPLY [Bug 51024] VLOOKUP/HLOOKUP default behaviour
https://issues.apache.org/bugzilla/show_bug.cgi?id=51024
Nick Burch <ni...@alfresco.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |WORKSFORME
--- Comment #1 from Nick Burch <ni...@alfresco.com> 2011-04-08 11:25:21 EDT ---
I've just added a unit test for this, which passes just fine:
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet s = wb.createSheet();
HSSFRow r1 = s.createRow(0);
HSSFRow r2 = s.createRow(1);
r1.createCell(0).setCellValue("v A1");
r2.createCell(0).setCellValue("v A2");
r1.createCell(1).setCellValue("v B1");
HSSFCell c = r1.createCell(4);
HSSFFormulaEvaluator eval = new HSSFFormulaEvaluator(wb);
c.setCellFormula("VLOOKUP(\"v A1\", A1:B2, 1)");
assertEquals("v A1", eval.evaluate(c).getStringValue());
c.setCellFormula("VLOOKUP(\"v A1\", A1:B2, 1, 1)");
assertEquals("v A1", eval.evaluate(c).getStringValue());
c.setCellFormula("VLOOKUP(\"v A1\", A1:B2, 1, )");
assertEquals("v A1", eval.evaluate(c).getStringValue());
c.setCellFormula("HLOOKUP(\"v A1\", A1:B2, 1)");
assertEquals("v A1", eval.evaluate(c).getStringValue());
c.setCellFormula("HLOOKUP(\"v A1\", A1:B2, 1, 1)");
assertEquals("v A1", eval.evaluate(c).getStringValue());
c.setCellFormula("HLOOKUP(\"v A1\", A1:B2, 1, )");
assertEquals("v A1", eval.evaluate(c).getStringValue());
Please make sure you're using a new enough version of POI
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org