The BASE function takes three arguments: number, radix, and min_length. Number should be an integer between 1 and 2^53. If number is negative, BASE returns a #NUM! error. The radix argument is used to specify base. Radix represents the number of digits used to represent numbers and should be an integer between 2 and 36. The optional min_length argument is the minimum string length that BASE should return. When min_length is provided, BASE will pad the output with zeros as needed to achieve the length specified.

Examples

The radix argument specifies base and the output from the BASE function is a text string. For example, the formulas below convert the number 13 into text representations of 13 in base 2 (binary), base 10 (decimal), and base 16 (hexadecimal): In the worksheet shown, the input numbers are being converted to three different representations: base 2 (binary), base 10 (decimal), and base 16 (hexadecimal). The formulas in D5, E5, and F5 are: The function also offers an optional argument min_length which will pad the returned string with zeros when its length is less than the given value. For example, the formulas below require a minimum length of 4:

DECIMAL function

The DECIMAL function performs the opposite conversion as the BASE function: See more on the DECIMAL function here.

Notes

The result from BASE is a text string. If number is negative, BASE returns a #NUM! error. BASE expects integers; decimal values are ignored.

Dave Bruns

Hi - I’m Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.