google script write value into one cell if another is not empty code example
Example 1: excel check if cell not empty
IF(A1<>"","Not empty","Empty")
Example 2: google script check if cell is empty
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
var range = sheet.getRange("B2:D4");
Logger.log(range.isBlank());