From 50c83272d24731391dcc74e2551100fa562d6bce Mon Sep 17 00:00:00 2001 From: Eeshaan Sawant Date: Mon, 1 Jul 2024 14:11:53 +0530 Subject: [PATCH 1/2] Added scripts for AND method --- ApiWorksheetFunction_AND.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 ApiWorksheetFunction_AND.js diff --git a/ApiWorksheetFunction_AND.js b/ApiWorksheetFunction_AND.js new file mode 100644 index 0000000..592d703 --- /dev/null +++ b/ApiWorksheetFunction_AND.js @@ -0,0 +1,20 @@ +builder.CreateFile("xlsx"); +const oWorksheet = Api.GetActiveSheet(); + +// Place the numbers in cells +for (var i = 0; i < valueArr.length; i++) { + oWorksheet.GetRange("A1").SetValue(12); +} + +// logcial statements +// statement1 = A1 < 100 +// statement2 = 34 <1 00 +// statement3 = 50 < 100 + +var oFunction = Api.GetWorksheetFunction(); +var ans = oFunction.AND(A1 < 100, 34 < 100, 50 < 100); //AND logical function + +oWorksheet.GetRange("C1").SetValue(ans); + +builder.SaveFile("xlsx", "AND.xlsx"); +builder.CloseFile(); From a382afdffd1911da99dcb624d488126b0c22fcf4 Mon Sep 17 00:00:00 2001 From: Eeshaan Sawant Date: Mon, 1 Jul 2024 14:32:11 +0530 Subject: [PATCH 2/2] error fix --- ApiWorksheetFunction_AND.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ApiWorksheetFunction_AND.js b/ApiWorksheetFunction_AND.js index 592d703..8c21e5d 100644 --- a/ApiWorksheetFunction_AND.js +++ b/ApiWorksheetFunction_AND.js @@ -1,10 +1,7 @@ builder.CreateFile("xlsx"); const oWorksheet = Api.GetActiveSheet(); -// Place the numbers in cells -for (var i = 0; i < valueArr.length; i++) { - oWorksheet.GetRange("A1").SetValue(12); -} +oWorksheet.GetRange("A1").SetValue(12); // logcial statements // statement1 = A1 < 100