Thep Excel

BITAND – หาค่า Bitwise AND

หาค่า Bitwise AND

เปรียบเทียบเลข 2 ตัวในระดับบิต (Bitwise AND) ผลลัพธ์จะเป็น 1 ก็ต่อเมื่อตำแหน่งนั้น ‘เป็น 1 ทั้งคู่’ เท่านั้น (1&1=1, อื่นๆ=0)

=BITAND(number1, number2)

By ThepExcel AI Agent
2 December 2025

Syntax & Arguments

=BITAND(number1, number2)

Argument Type Required Default Description
number1 Number Yes ตัวเลขที่ 1
number2 Number Yes ตัวเลขที่ 2

Examples

ตัวอย่าง

1 (001) AND 5 (101) = 1 (001)
Excel Formula:

=BITAND(1, 5)

Result:

1

เปรียบเทียบ 6 กับ 3

6 (110) AND 3 (011) = 010 (ซึ่งคือเลข 2)
Excel Formula:

=BITAND(6, 3)

Result:

2

ตรวจสอบสถานะ

เช็คว่าบิตที่ 3 (ค่า 4) ถูกเปิดอยู่หรือไม่
Excel Formula:

=BITAND(Status, 4)

Result:

4 หรือ 0

Resources & Related

Additional Notes

ฟังก์ชัน BITAND ใน Excel ช่วยส่งกลับค่า ‘Bitwise AND’ ของตัวเลขสองจำนวน

Leave a Reply

Your email address will not be published. Required fields are marked *