From: PJ Fanning Date: Fri, 27 May 2022 11:44:46 +0000 (+0000) Subject: add VARPA and STDEVPA functions X-Git-Tag: REL_5_2_3~275 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8d76de41aff415718aeb3e8658407576723f8b71;p=poi.git add VARPA and STDEVPA functions git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1901321 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestStdev.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestStdev.java index 2397ad99fe..e56a7d79d7 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestStdev.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestStdev.java @@ -29,13 +29,15 @@ import static org.apache.poi.ss.util.Utils.addRow; import static org.apache.poi.ss.util.Utils.assertDouble; /** - * Testcase for functions: STDEV(), STDEVP(), STDEV.S(), STDEV.P() + * Testcase for functions: STDEV(), STDEVP(), STDEV.S(), STDEV.P(), STDEVA(), STDEVPA() */ public class TestStdev { //https://support.microsoft.com/en-us/office/stdevp-function-1f7c1c88-1bec-4422-8242-e9f7dc8bb195 //https://support.microsoft.com/en-us/office/stdev-p-function-6e917c05-31a0-496f-ade7-4f4e7462f285 //https://support.microsoft.com/en-us/office/stdev-s-function-7d69cf97-0c1f-4acf-be27-f3e83904cc23 + //https://support.microsoft.com/en-us/office/stdeva-function-5ff38888-7ea5-48de-9a6d-11ed73b29e9d + //https://support.microsoft.com/en-us/office/stdevpa-function-5578d4d6-455a-4308-9991-d405afe2c28c @Test void testMicrosoftExample1() throws IOException { try (HSSFWorkbook wb = initWorkbook1()) { @@ -43,8 +45,10 @@ public class TestStdev { HSSFCell cell = wb.getSheetAt(0).getRow(0).createCell(12); assertDouble(fe, cell, "STDEVP(A3:A12)", 26.0545581424825, 0.00000000001); assertDouble(fe, cell, "STDEV.P(A3:A12)", 26.0545581424825, 0.00000000001); + assertDouble(fe, cell, "STDEVPA(A3:A12)", 26.0545581424825, 0.00000000001); assertDouble(fe, cell, "STDEV(A3:A12)", 27.4639157198435, 0.00000000001); assertDouble(fe, cell, "STDEV.S(A3:A12)", 27.4639157198435, 0.00000000001); + assertDouble(fe, cell, "STDEVA(A3:A12)", 27.4639157198435, 0.00000000001); } } diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestVar.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestVar.java index e569a2e468..22ab4ad3c8 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestVar.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestVar.java @@ -29,12 +29,14 @@ import static org.apache.poi.ss.util.Utils.addRow; import static org.apache.poi.ss.util.Utils.assertDouble; /** - * Testcase for functions: VAR.S(), VAR.P() + * Testcase for functions: VAR.S(), VAR.P(), VARA(), VARPA() */ public class TestVar { //https://support.microsoft.com/en-us/office/var-s-function-913633de-136b-449d-813e-65a00b2b990b //https://support.microsoft.com/en-us/office/var-p-function-73d1285c-108c-4843-ba5d-a51f90656f3a + //https://support.microsoft.com/en-us/office/vara-function-3de77469-fa3a-47b4-85fd-81758a1e1d07 + //https://support.microsoft.com/en-us/office/varpa-function-59a62635-4e89-4fad-88ac-ce4dc0513b96 @Test void testMicrosoftExample1() throws IOException { try (HSSFWorkbook wb = initWorkbook1()) { @@ -42,8 +44,10 @@ public class TestVar { HSSFCell cell = wb.getSheetAt(0).getRow(0).createCell(12); assertDouble(fe, cell, "VARP(A3:A12)", 678.84, 0.00000000001); assertDouble(fe, cell, "VAR.P(A3:A12)", 678.84, 0.00000000001); - assertDouble(fe, cell, "VAR(A3:A12)", 754.27, 0.005); - assertDouble(fe, cell, "VAR.S(A3:A12)", 754.27, 0.005); + assertDouble(fe, cell, "VARPA(A3:A12)", 678.84, 0.00000000001); + assertDouble(fe, cell, "VAR(A3:A12)", 754.26667, 0.00005); + assertDouble(fe, cell, "VAR.S(A3:A12)", 754.26667, 0.00005); + assertDouble(fe, cell, "VARA(A3:A12)", 754.26667, 0.00005); } }