How can I perform a bitwise left shift operation in Excel?

How can I perform a bitwise left shift operation in Excel?

A bitwise left shift operation in Excel is a mathematical operation that moves all the bits in a binary number to the left by a specified number of positions, padding the empty spaces with zeros. This operation is commonly used in computer programming to perform quick multiplication or division by powers of two. In Excel, this operation can be performed by using the BITLSHIFT function, which takes in two arguments – the binary number and the number of positions to shift. This function returns the shifted binary number, allowing users to easily perform bitwise left shift operations in their spreadsheets.

This article describes the formula syntax and usage of the BITLSHIFT function
in Microsoft Excel.

Description

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

Syntax

BITLSHIFT(number, shift_amount)

The BITLSHIFT function syntax has the following arguments.

  • Number    Required. Number must be an integer greater than or equal to 0.

  • Shift_amount    Required. Shift_amount must be an integer.

Remarks

  • Shifting a number left is equivalent to adding zeros (0) to the right of the binary representation of the number. For example, a 2-bit shift to the left on the decimal value 4 converts its binary value (100) to 10000, or 16 in decimal.

  • If either argument is outside their constraints, BITLSHIFT returns the #NUM! error value.

  • If Number is greater than (2^48)-1, BITLSHIFT returns the #NUM! error value.

  • If the absolute value of Shift_amount is greater than 53, BITLSHIFT returns the #NUM! error value.

  • If either argument is a non-numeric value, BITLSHIFT returns the #VALUE! error value.

  • A negative number used as the Shift_amount argument shifts the number of bits to the right.

  • A negative number used as the Shift_amount argument returns the same result as a positive shift_amount argument for the BITRSHIFT function.

Cite this article

stats writer (2024). How can I perform a bitwise left shift operation in Excel?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-i-perform-a-bitwise-left-shift-operation-in-excel/

stats writer. "How can I perform a bitwise left shift operation in Excel?." PSYCHOLOGICAL SCALES, 28 Jun. 2024, https://scales.arabpsychology.com/stats/how-can-i-perform-a-bitwise-left-shift-operation-in-excel/.

stats writer. "How can I perform a bitwise left shift operation in Excel?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-can-i-perform-a-bitwise-left-shift-operation-in-excel/.

stats writer (2024) 'How can I perform a bitwise left shift operation in Excel?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-i-perform-a-bitwise-left-shift-operation-in-excel/.

[1] stats writer, "How can I perform a bitwise left shift operation in Excel?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, June, 2024.

stats writer. How can I perform a bitwise left shift operation in Excel?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.

Download Post (.PDF)
Slide Up
x
PDF
Scroll to Top