From 6416fd62e280be7cc3a1698dcfc6f0c898782938 Mon Sep 17 00:00:00 2001 From: Eeshaan Sawant Date: Sat, 29 Jun 2024 17:47:19 +0530 Subject: [PATCH] Added scripts for STDEV method --- ApiWorksheetFunction_STDEV.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 ApiWorksheetFunction_STDEV.js diff --git a/ApiWorksheetFunction_STDEV.js b/ApiWorksheetFunction_STDEV.js new file mode 100644 index 0000000..cb9afb9 --- /dev/null +++ b/ApiWorksheetFunction_STDEV.js @@ -0,0 +1,17 @@ +builder.CreateFile("xlsx"); +const oWorksheet = Api.GetActiveSheet(); + +var valueArr = [3, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 0, 1, 13, 14]; + +// 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.STDEV(3, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 0, 1, 13, 14); + +oWorksheet.GetRange("C1").SetValue(ans); + +builder.SaveFile("xlsx", "STDEV.xlsx"); +builder.CloseFile();