This function has been introduced with Excel 2013 and it returns bit-wise “OR” of 2 numbers.
For example, binary representation of 3 is 11 and for 10 it is 1010 and we can check that we have 1 in 1st, 2nd and 4th postition – in common in both binaries from right to left i.e.,
10 -> 1010
3 -> 11
Hence, starting from right it is, 2^0+2^1+2^3 which would result in 11. Note that 2^2 would not be included as 3rd position from right, do not have 1 in both the binaries.
Using formula, we can obtain the same result using formula as:-
which would result in 11.
where number 1 and number 2 must be greater than or equal to zero.
Note:- You’ll get #VALUE! error if you enter any non-numeric character in place of number 1 and number 2.
The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.