diff options
-rw-r--r-- | poi/src/main/java/org/apache/poi/ss/formula/atp/XLookupFunction.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/poi/src/main/java/org/apache/poi/ss/formula/atp/XLookupFunction.java b/poi/src/main/java/org/apache/poi/ss/formula/atp/XLookupFunction.java index 164af5681e..a9bef0407b 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/atp/XLookupFunction.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/atp/XLookupFunction.java @@ -58,7 +58,11 @@ final class XLookupFunction implements FreeRefFunction { if (matchedRow != -1) { if (valueEval instanceof AreaEval) { AreaEval area = (AreaEval)valueEval; - return area.getRelativeValue(matchedRow, 0); + if (area.getWidth() == 1) { + return area.getRelativeValue(matchedRow, 0); + } else { + return area.getRow(matchedRow); + } } } return ErrorEval.NUM_ERROR; |