Formualizer Docs
ReferenceFunctionsEngineering Functions

BITAND

BITAND: Returns the bitwise AND of two non-negative integers.

Summary

Combines matching bits from both inputs and keeps only bits set in both numbers.

Remarks

  • Arguments are coerced to numbers and must be whole numbers in the range [0, 2^48).
  • Returns #NUM! for negative values, fractional values, or values outside the supported range.
  • Propagates input errors.

Examples

Mask selected bits
Grid
CellValue
No inputs on Sheet1.
Formula
=
Result
Not evaluated yet.
Expected
8
Check least-significant bit
Grid
CellValue
No inputs on Sheet1.
Formula
=
Result
Not evaluated yet.
Expected
1

FAQ

When does BITAND return #NUM!?

Inputs must be whole numbers in [0, 2^48); negatives, fractions, and out-of-range values return #NUM!.

Runtime metadata

Category

Engineering

Signature

BITAND(arg1: Number, arg2: Number)

Arity

min 2, max 2

Arguments

arg1

Number · Scalar · coercion NumberLenientText

arg2

Number · Scalar · coercion NumberLenientText

Caps

PURE

Source

On this page