From: PJ Fanning Date: Sat, 7 Aug 2021 23:56:22 +0000 (+0000) Subject: tidy up X-Git-Tag: REL_5_1_0~57 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c79ef7f76d7778c6fa49d976df72cde7f0747d87;p=poi.git tidy up git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1892097 13f79535-47bb-0310-9956-ffa450edef68 --- 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;