From c79ef7f76d7778c6fa49d976df72cde7f0747d87 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Sat, 7 Aug 2021 23:56:22 +0000 Subject: [PATCH] tidy up git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1892097 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/poi/ss/formula/atp/XLookupFunction.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; -- 2.39.5