Bug 52063 - Implement LOOKUP(lookup_value,array)
Summary: Implement LOOKUP(lookup_value,array)
Alias: None
Product: POI
Classification: Unclassified
Component: SS Common (show other bugs)
Version: 3.17-dev
Hardware: PC All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2011-10-20 09:20 UTC by Marcel May
Modified: 2017-06-20 06:13 UTC (History)
1 user (show)


Note You need to log in before you can comment on or make changes to this bug.
Description Marcel May 2011-10-20 09:20:54 UTC
Excel-Sheets containing LOOKUP(lookup_value,array) formula fail since its not yet implemented:

java.lang.RuntimeException: Two arg version of LOOKUP not supported yet
	at org.apache.poi.ss.formula.functions.Lookup.evaluate(Lookup.java:44)
	at org.apache.poi.ss.formula.functions.Var2or3ArgFunction.evaluate(Var2or3ArgFunction.java:34)
	at org.apache.poi.ss.formula.OperationEvaluatorFactory.evaluate(OperationEvaluatorFactory.java:132)
	at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateFormula(WorkbookEvaluator.java:460)
	at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:283)
	at org.apache.poi.ss.formula.WorkbookEvaluator.evaluate(WorkbookEvaluator.java:225)
	at org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.evaluateFormulaCellValue(HSSFFormulaEvaluator.java:354)
	at org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.evaluate(HSSFFormulaEvaluator.java:185)

I'll try to provide a test case and an implementation.
Comment 2 Dominik Stadler 2015-05-31 22:09:27 UTC
The LOOKUP function is available in latest POI, therefore resolving this as FIXED.
Comment 3 Gaurang Omar 2017-03-28 05:46:54 UTC
I am using Apache POI version 3.15 and I am still getting this error message.
Comment 4 Javen O'Neal 2017-06-20 05:49:15 UTC
You are correct. The 2-arg variant wasn't implemented in POI 3.15 (or 3.16 for that matter).

I implemented this with a corresponding unit test in r1799302.

Will be included in 3.17 beta 1.