Google Sheets BITOR Function: Syntax, Examples & Tips

The BITOR function performs a bitwise OR operation on two numbers, returning a number that represents the combined bits of both inputs.
Google Sheets
BITOR(value1, value2)

One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.

On this page
  1. Parameters
  2. What is a BITOR?
  3. A Practical Example
  4. BITOR Formula
  5. Result of the Formula
  6. Why Use BITOR?
  7. Key Takeaways:
  8. Example use case

Parameters

value1:
The first value or bitwise expression that you want to evaluate. This can be a number, a cell reference, or a binary representation.

value2:
The second value or bitwise expression that you want to evaluate. This can also be a number, a cell reference, or a binary representation.

What is a BITOR?

The BITOR function in Google Sheets is a bitwise operation function that performs a bitwise OR operation on two numbers. This function is particularly useful when working with binary data or when you need to manipulate individual bits of numbers. The BITOR function takes two integer arguments and returns a single integer that represents the result of the bitwise OR operation.

In simpler terms, BITOR allows you to combine two numbers at the bit level, turning on bits in the result wherever there is a '1' in either of the input numbers.

A Practical Example

Imagine you are working with binary flags to represent certain features of a product:

Product Features Table:

ProductIDFeature1Feature2Feature3
1101
2011

In this table, each feature is represented as a binary value (1 for present, 0 for absent). You want to combine the features of two products to see which features are available when they are combined.

BITOR Formula

To achieve this, you would use the BITOR function as follows:

Google Sheets
=BITOR(A2, A3)

In this formula:

  • A2 is the cell containing the binary representation of the features for Product 1.
  • A3 is the cell containing the binary representation of the features for Product 2.

Result of the Formula

When you apply the BITOR formula to the Product Features Table, the output would look like this:

Combined Features
1
1

In this case, if you input the binary values for Product 1 (101) and Product 2 (011), the BITOR would return 111, indicating that all features are present when both products are combined.

Why Use BITOR?

BITOR is beneficial because it simplifies the process of combining binary data. It allows for efficient manipulation of bits without the need for complex logical operations. This function is particularly useful in scenarios involving feature flags, permissions, or any situation where binary representation is utilized.

Key Takeaways:

  • BITOR: A function that performs a bitwise OR operation on two integers.
  • Bit Manipulation: Useful for combining binary data and flags efficiently.
  • Simplicity: Provides a straightforward way to work with binary values without complex logic.
  • Common Use Cases: Ideal for feature flags, permissions management, and any scenario involving binary data manipulation.

BITOR is an essential function for anyone working with binary data in Google Sheets, providing a powerful way to enhance data analysis and manipulation capabilities.

Happy spreadsheeting!

Example use case

You have a table with binary flags in Column A and Column B. By using the BITOR formula, you can combine these flags to determine if any specific conditions are met, streamlining decision-making processes based on multiple criteria in your data analysis.

Need more help with Google Sheets formulas?

Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.

Explore all Google Sheets formulas

Browse our complete library of Google Sheets formula guides

Compare your options

Decide with evidence, not a sales pitch.

Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.

  1. 01ChatGPTOpen a balanced comparison prompt in ChatGPT.
  2. 02ClaudeOpen the same research prompt in Claude.
  3. 03PerplexityResearch the comparison with linked web sources.

AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.