This script shows first or second result – based on condition:

  • function main(workbook: ExcelScript.Workbook,
    myvariable: number,
    resultvariable: number,
    {
      myvariable = 222;
      if (myvariable > 123) {resultvariable = 11 } else { resultvariable = 22 };
      console.log(resultvariable );
    }