The BITRSHIFT function shifts the bits of the input a certain number of places to the right. Bits on the left are filled with zeroes.
Parts of a BITRSHIFT function
||The number to be shifted.||
||The number of places to shift the given value.||
Values don't necessarily have to be numbers. Instead, they may be coerced. For example, a string value of "3" can be coerced to be simply 3, and a Boolean value of TRUE can be coerced to 1.
In the following example, we use BITRSHIFT with values inlined into the function. The value 8 (represented as 1000 in base 2) has its bits shifted right by the shift amount of 2, resulting in 2 (represented as 10 in base 2):
In the next example, a value of 8 being shifted by 2 results in a BITRSHIFT of 2. However, this time we use cell references to use as our values:
BITLSHIFT: The BITLSHIFT function shifts the bits of the input a certain number of places to the left. Bits on the right are filled with zeroes (0s).