BASE
The BASE function in Google Sheets converts a number into a text representation in another base. It is commonly used to convert numbers into binary form by specifying a base of 2. Explore this comprehensive guide to learn how to use the BASE function effectively.
Function Syntax and Parameters
Syntax: BASE(value, base, [min_length])
Parameters:
value: The number to be converted into a different base.base: The base to which the number should be converted. For example, use 2 for binary, 16 for hexadecimal, etc.[min_length]: [Optional] The minimum number of digits that the result should contain. If the minimum length is not reached, zeros are added to the left.
Step-by-Step Tutorial
-
Convert a number to a different base:
- Example:
=BASE(10, 2) - Result:
1010
- Example:
-
Apply a minimum length to the result:
- Example:
=BASE(10, 2, 8) - Result:
00001010
- Example:
Use Cases and Scenarios
- Binary Conversion: Convert numbers to binary representation.
- Hexadecimal Conversion: Convert numbers to hexadecimal representation.
- Custom Base Conversion: Convert numbers to a custom base representation.
Related Functions
DEC2BIN: Convert a decimal number to binary.HEX2DEC: Convert a hexadecimal number to decimal.BIN2DEC: Convert a binary number to decimal.