BASE

The BASE function converts a number to a text representation in a specified base, using characters 0-9 and A-Z. It allows representation of numbers in bases up to 36, such as binary, octal, or hexadecimal.

Try out BASE
A blurred spreadsheet editor.

Example explanation
Cell B2 uses the BASE function to convert the decimal number in cell A2 (255) to a base 16 representation (FF). The same thing happens in cell C2 but it's converted to a base 2 representation.

Syntax 🔗

=BASE(Number, Radix, [Min length])

Number The number to be converted to a different base.
Radix The base to use for the conversion. It is an integer between 2 and 36.
Min length (Optional) The minimum length of the output. It prefixes the result with 0s to reach the desired length if necessary.

About BASE 🔗

The BASE function in Excel allows you to convert numbers into different base systems, such as binary (base 2), octal (base 8), hexadecimal (base 16), or any base up to 36. This can be useful for displaying numerical data in various formats. You can specify the desired base and adjust optional parameters to create text representations that meet your needs. This function is particularly useful in fields like computer science and mathematics where working with different base systems is common. Use BASE to explore and convert between numerical bases in your Excel tasks.

Examples 🔗

To convert the decimal number 123 to binary (base 2), use the formula: =BASE(123, 2). This will yield the result: 1111011.

To convert the decimal number 255 to hexadecimal (base 16) with a minimum output length of 4, use the formula: =BASE(255, 16, 4). This will produce the result: 00FF.

Notes 🔗

The BASE function allows you to input positive and negative integers, as well as floating-point numbers. Ensure the radix is between 2 and 36. If you use the Min length parameter, it pads the result with leading zeroes to reach the desired length.

Questions 🔗

What numerical bases can the BASE function handle?

The BASE function can handle numerical bases ranging from 2 to 36, inclusive. It translates the provided number into a text representation using the characters 0-9 and A-Z for bases exceeding 10.

Can the BASE function convert negative numbers?

Yes, the BASE function can convert both positive and negative numbers into their corresponding representations in the specified base.

How does the Min length parameter affect the output of the BASE function?

The Min length parameter, if specified, prefixes the result with 0s to attain the desired minimum length. This can be useful for ensuring consistent output formats, especially when working with fixed-length representations in numerical systems.

DEC2BIN
BIN2DEC
DEC2HEX
HEX2DEC
DEC2OCT
OCT2DEC

Leave a Comment