Skip to main content

BITLSHIFT

Returns a number shifted left by the specified number of bits.

Syntax

expression.BITLSHIFT(arg1, arg2);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | numberThe decimal representation of the binary number to evaluate.
arg2RequiredApiRange | ApiName | numberThe number of bits by which the number will be shifted left.

Returns

number

Example

Shift a number left by a given number of bits in a spreadsheet.

// What happens when you move the binary representation leftward in a spreadsheet?

// Multiply a value by moving its bits toward higher positions in a spreadsheet.

let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
worksheet.GetRange("A1").SetValue(func.BITLSHIFT(4, 2));