From cec3b99037be55b71876de50c57712785b7836c3 Mon Sep 17 00:00:00 2001 From: Eeshaan Sawant Date: Sat, 29 Jun 2024 17:57:53 +0530 Subject: [PATCH] Added scripts for STDEVP method --- ApiWorksheetFunction_STDEVP.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 ApiWorksheetFunction_STDEVP.js diff --git a/ApiWorksheetFunction_STDEVP.js b/ApiWorksheetFunction_STDEVP.js new file mode 100644 index 0000000..83320b4 --- /dev/null +++ b/ApiWorksheetFunction_STDEVP.js @@ -0,0 +1,17 @@ +builder.CreateFile("xlsx"); +const oWorksheet = Api.GetActiveSheet(); + +var valueArr = [1, 0, 0, 0, 4, 1, 0, 0, 2, 3, 6, 7, 6, 8, 10, 12]; + +// Place the numbers in cells +for (var i = 0; i < valueArr.length; i++) { + oWorksheet.GetRange("A" + (i + 1)).SetValue(valueArr[i]); +} + +var oFunction = Api.GetWorksheetFunction(); +var ans = oFunction.STDEVP(1, 0, 0, 0, 4, 1, 0, 0, 2, 3, 6, 7, 6, 8, 10, 12); + +oWorksheet.GetRange("C1").SetValue(ans); + +builder.SaveFile("xlsx", "STDEVP.xlsx"); +builder.CloseFile();