Skip to main content

NOT

Checks if the specified logical value is true or false. The function returns true if the argument is false and false if the argument is true.

Syntax​

expression.NOT(arg1);

expression - A variable that represents an ApiWorksheetFunction class.

Parameters​

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | number | string | booleanA value or expression that can be evaluated to true or false.

Returns​

boolean

Example​

Reverse a boolean value in a spreadsheet.

// How do I negate a true or false value in a spreadsheet?

// Get the opposite result of a logical condition in a spreadsheet.

const worksheet = Api.GetActiveSheet();

let condition = 12 < 100;
let func = Api.WorksheetFunction;
let ans = func.NOT(condition);

worksheet.GetRange("C1").SetValue(ans);