BITLSHIFT Function
The BITLSHIFT
function in Google Sheets is used to shift the bits of a number to the left by a specified number of places.
Syntax
BITLSHIFT(value, shift_amount)
- value: The number whose bits you want to shift. This is a required parameter.
- shift_amount: The number of positions to shift the bits to the left. This is also a required parameter.
Examples
- Basic Shift
Shift the bits of 4
to the left by 2
places:
=BITLSHIFT(4, 2)
This will output 16
.
- Shift with Negative Value
Shift the bits of 3
to the left by 1
place:
=BITLSHIFT(3, 1)
This will output 6
.
Notes
- A left shift operation effectively multiplies the number by 2 for each position shifted.
- The function only accepts positive integers for the
shift_amount
.