Table of Contents
The BITRSHIFT function in Google Sheets allows users to perform a bitwise right shift operation on a given number. This function takes two inputs: the number to be shifted and the number of bits to shift by. The result is a new number with the bits shifted to the right by the specified amount. This function can be useful for manipulating binary data and performing logical operations. To use the BITRSHIFT function, simply enter the function name followed by the two inputs in the desired cells. This function can help simplify and streamline data analysis and calculations in Google Sheets.
BITRSHIFT function
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
BITRSHIFT(value, shift_amount)
| Part | Description | Notes |
value | The number to be shifted. |
|
shift_amount | The number of places to shift the given value. |
|
Sample formulas
BITRSHIFT(18, 2)
BITRSHIFT(A2, 4)
Notes
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.
Examples
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):
| A | B | |
| 1 | Formula | Result |
| 2 | =BITRSHIFT(8, 2) | 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:
| A | B | C | |
| 1 | Formula | Result | Reference cells |
| 2 | =BITRSHIFT(C2, C3) | 2 | 8 |
| 3 | 2 |
Related function
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).
Cite this article
stats writer (2024). How can I use the BITRSHIFT function in Google Sheets to perform a bitwise right shift operation on a given number?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-i-use-the-bitrshift-function-in-google-sheets-to-perform-a-bitwise-right-shift-operation-on-a-given-number/
stats writer. "How can I use the BITRSHIFT function in Google Sheets to perform a bitwise right shift operation on a given number?." PSYCHOLOGICAL SCALES, 28 Jun. 2024, https://scales.arabpsychology.com/stats/how-can-i-use-the-bitrshift-function-in-google-sheets-to-perform-a-bitwise-right-shift-operation-on-a-given-number/.
stats writer. "How can I use the BITRSHIFT function in Google Sheets to perform a bitwise right shift operation on a given number?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-can-i-use-the-bitrshift-function-in-google-sheets-to-perform-a-bitwise-right-shift-operation-on-a-given-number/.
stats writer (2024) 'How can I use the BITRSHIFT function in Google Sheets to perform a bitwise right shift operation on a given number?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-i-use-the-bitrshift-function-in-google-sheets-to-perform-a-bitwise-right-shift-operation-on-a-given-number/.
[1] stats writer, "How can I use the BITRSHIFT function in Google Sheets to perform a bitwise right shift operation on a given number?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, June, 2024.
stats writer. How can I use the BITRSHIFT function in Google Sheets to perform a bitwise right shift operation on a given number?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.
