mirror of
https://github.com/apache/poi.git
synced 2026-02-27 20:40:08 +08:00
add VARPA and STDEVPA functions
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1901321 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
fd3ef2c364
commit
8d76de41af
@ -29,13 +29,15 @@ import static org.apache.poi.ss.util.Utils.addRow;
|
|||||||
import static org.apache.poi.ss.util.Utils.assertDouble;
|
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 {
|
public class TestStdev {
|
||||||
|
|
||||||
//https://support.microsoft.com/en-us/office/stdevp-function-1f7c1c88-1bec-4422-8242-e9f7dc8bb195
|
//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-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/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
|
@Test
|
||||||
void testMicrosoftExample1() throws IOException {
|
void testMicrosoftExample1() throws IOException {
|
||||||
try (HSSFWorkbook wb = initWorkbook1()) {
|
try (HSSFWorkbook wb = initWorkbook1()) {
|
||||||
@ -43,8 +45,10 @@ public class TestStdev {
|
|||||||
HSSFCell cell = wb.getSheetAt(0).getRow(0).createCell(12);
|
HSSFCell cell = wb.getSheetAt(0).getRow(0).createCell(12);
|
||||||
assertDouble(fe, cell, "STDEVP(A3:A12)", 26.0545581424825, 0.00000000001);
|
assertDouble(fe, cell, "STDEVP(A3:A12)", 26.0545581424825, 0.00000000001);
|
||||||
assertDouble(fe, cell, "STDEV.P(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(A3:A12)", 27.4639157198435, 0.00000000001);
|
||||||
assertDouble(fe, cell, "STDEV.S(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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -29,12 +29,14 @@ import static org.apache.poi.ss.util.Utils.addRow;
|
|||||||
import static org.apache.poi.ss.util.Utils.assertDouble;
|
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 {
|
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-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/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
|
@Test
|
||||||
void testMicrosoftExample1() throws IOException {
|
void testMicrosoftExample1() throws IOException {
|
||||||
try (HSSFWorkbook wb = initWorkbook1()) {
|
try (HSSFWorkbook wb = initWorkbook1()) {
|
||||||
@ -42,8 +44,10 @@ public class TestVar {
|
|||||||
HSSFCell cell = wb.getSheetAt(0).getRow(0).createCell(12);
|
HSSFCell cell = wb.getSheetAt(0).getRow(0).createCell(12);
|
||||||
assertDouble(fe, cell, "VARP(A3:A12)", 678.84, 0.00000000001);
|
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.P(A3:A12)", 678.84, 0.00000000001);
|
||||||
assertDouble(fe, cell, "VAR(A3:A12)", 754.27, 0.005);
|
assertDouble(fe, cell, "VARPA(A3:A12)", 678.84, 0.00000000001);
|
||||||
assertDouble(fe, cell, "VAR.S(A3:A12)", 754.27, 0.005);
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user