From e52e874d28aedf68a39098dfa8964749f126ab36 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Mon, 6 Dec 2021 12:02:24 +0000 Subject: [PATCH] add xmatch test git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1895619 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/poi/ss/formula/atp/TestXMatchFunction.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/poi/src/test/java/org/apache/poi/ss/formula/atp/TestXMatchFunction.java b/poi/src/test/java/org/apache/poi/ss/formula/atp/TestXMatchFunction.java index a9656e4070..e656d2782d 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/atp/TestXMatchFunction.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/atp/TestXMatchFunction.java @@ -72,6 +72,16 @@ public class TestXMatchFunction { } } + @Test + void testMicrosoftExample4() throws IOException { + try (HSSFWorkbook wb = new HSSFWorkbook()) { + HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb); + HSSFCell cell = wb.createSheet().createRow(0).createCell(0); + assertDouble(fe, cell, "XMATCH(4,{5,4,3,2,1})", 2); + assertDouble(fe, cell, "XMATCH(4.5,{5,4,3,2,1},1)", 1); + } + } + private HSSFWorkbook initNumWorkbook(String lookup) { HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet(); -- 2.39.5