
Return TRUE when a value is a valid binary string made only of 0s and 1s.
ISBINARY checks whether a value is a valid binary string. If the value contains only 0 and 1, it returns TRUE. If it contains anything else, it returns FALSE.
This is mostly useful as a safety check before you run functions like BIN2DEC. It helps you stop bad inputs early instead of letting one wrong character turn into an error later.
Returns TRUE only when the value is made of 0s and 1s.
TRUE means the value is valid binary. FALSE means it is not.
=ISBINARY(value)
Use a cell reference or a typed string. For example, =ISBINARY("1011") returns TRUE, while =ISBINARY("1021") returns FALSE.
| Function | Main job | Use it when |
|---|---|---|
ISBINARY |
Checks if a string is valid binary | You want to validate binary input first. |
BIN2DEC |
Converts binary to decimal | You already trust the input and want the decimal result. |
ISTEXT |
Checks whether something is text | You only care whether the value is text, not whether it is valid binary. |
ISNUMBER |
Checks whether something is numeric | You need a number test rather than a binary-format test. |
The usual pattern is simple: test first, convert second. If you run BIN2DEC on a bad string, Excel throws an error. If you run ISBINARY first, you can stop the bad value before that happens.
It also helps when your binary codes have leading zeros. A value like "0011" is still valid binary, and ISBINARY handles that correctly.
This is the basic use.
=ISBINARY("1010") // Returns TRUE.
Check whether "1010" is valid binary. Formula: =ISBINARY("1010").
The value fails as soon as one non-binary digit appears.
=ISBINARY("1021") // Returns FALSE.
Check whether "1021" is valid binary. Formula: =ISBINARY("1021").
Leading zeros are still part of a valid binary string.
=ISBINARY("00001101") // Returns TRUE.
Check whether the value in A1 is valid binary. Formula: =ISBINARY(A1).
This is a cleaner way to handle invalid input.
=IF(ISBINARY(B1),"Clean","Invalid")
Check whether the value in B1 is valid binary. Formula: =ISBINARY(B1).
ISBINARY checks whether a value is valid binary text.Tell your friends about this post