BITLSHIFT

Formulas / BITLSHIFT
The BITLSHIFT formula performs a bitwise left shift operation on an integer, shifting its bits a specified number of positions to the left and returning the result as an integer.
BITLSHIFT(number, shift_amount)
  • number - The integer whose bits you want to shift to the left.
  • shift_amount - The number of positions by which to shift the bits to the left.

Examples

  • =BITLSHIFT(5, 2)

    This formula performs a bitwise left shift operation on the integer 5 (binary 0101), shifting its bits 2 positions to the left, resulting in the integer 20 (binary 10100).

  • =BITLSHIFT(12, 3)

    This formula performs a bitwise left shift operation on the integer 12 (binary 1100), shifting its bits 3 positions to the left, resulting in the integer 96 (binary 1100000).

Summary

The BITLSHIFT formula performs a bitwise left shift operation on an integer, shifting its bits a specified number of positions to the left and returning the result as an integer.

  • The BITLSHIFT function is a mathematical function that performs a bitwise left shift operation on an integer, shifting its bits a specified number of positions to the left and returning the result as an integer.
  • BITLSHIFT takes two arguments, "number" and "shift_amount," where "number" is the integer whose bits are to be shifted, and "shift_amount" is the number of positions by which the bits should be shifted to the left.
  • If the arguments provided to BITLSHIFT are not valid integers, the function returns a #NUM! error. Fractional numbers are truncated to integers before the operation. The "shift_amount" argument must be a non-negative integer.

Frequently Asked Questions

What does the BITLSHIFT function do?
The BITLSHIFT function performs a bitwise left shift operation on an integer, shifting its bits a specified number of positions to the left and returning the result as an integer.
What are the arguments of the BITLSHIFT function?
The BITLSHIFT function has two arguments: "number" and "shift_amount." The "number" argument is the integer whose bits are to be shifted to the left, and the "shift_amount" argument specifies the number of positions by which the bits should be shifted.
What happens if the arguments provided to BITLSHIFT are not valid integers?
If the arguments provided to BITLSHIFT are not valid integers, the function returns a #NUM! error.
Can BITLSHIFT handle negative integers or negative shift amounts?
BITLSHIFT can handle negative integers as the "number" argument, but the "shift_amount" argument must be a non-negative integer. If a negative "shift_amount" is provided, the function returns a #NUM! error.
How does BITLSHIFT handle fractional numbers?
If fractional numbers are provided as arguments to BITLSHIFT, the function will truncate the numbers to integers before performing the bitwise left shift operation.

Make Better Decisions
With Data

Analyze data, automate reports and create live dashboards
for all your business applications, without code. Get unlimited access free for 14 days.