How to use the BASE function
What is the BASE function?
The BASE function converts a decimal number into a text representation with a given radix (base).
What is a radix (base)?
The radix or base refers to the number of unique digits in numeral systems that represents the numbers. Common radices are 2 (binary), 8 (octal), 10 (decimal), 16 (hexadecimal).
Changing the radix changes the digit representations but the numeric values are equivalent. The radix determines the inventory of digits used to express values.
What is a text representation?
The BASE function takes numbers as input, however, the output is a text string. This limits Excel's capabilities, for example performing arithmetic calculations to the converted text value are not possible unless you convert the text string back to the decimal system.
What is the decimal numeral system?
The decimal system is the numbers we use every day: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 It is based on the radix (base) of 10, this means there are 10 digits: 0 to 9.
What base conversion functions does Excel have?
These functions convert from the decimal system to the binary, octal and hexadecimal systems.
DEC2BIN | DEC2OCT | DEC2HEX
These functions convert from the binary system to the decimal, octal and hexadecimal systems.
BIN2DEC | BIN2OCT | BIN2HEX
These functions convert from the octal system to the binary, decimal and hexadecimal systems.
OCT2DEC | OCT2BIN | OCT2HEX
These functions convert from the hexadecimal system to the binary, octal and decimal systems.
HEX2BIN | HEX2DEC | HEX2OCT
These functions are located in the "Engineering" category.
Is there a function that converts from any numeral system to the decimal system?
Yes, the DECIMAL function lets you convert numbers to the decimal system.
The DECIMAL function converts a text representation of a number in a given base into a decimal number.
Function syntax: DECIMAL(text, radix)
Excel Function Syntax
BASE(number, radix, [min_length])
Arguments
number | Required. The number that you want to convert. Must be an integer greater than or equal to 0 (zero) and less than 2^53. |
radix | Required. The base of the number you want it to convert into. 2 <= radix <= 36. |
[min_length] | Optional. The minimum length of the returned string. [min_length] must be an integer greater than or eual to 0 (zero). |
Comments
Use the min_length argument to add leading zeros to the resulting value. BASE(16,2) returns 10000, however, BASE(16,2,8) returns 00010000.
The DC2BIN function also allows you to convert numbers into binary values.
Recommended articles
The DEC2BIN function converts a decimal number to a binary number. What is a decimal number? The decimal system is […]
The DECIMAL function converts a text representation of a number in a given base into a decimal number.
Recommended articles
What is the DECIMAL function? The DECIMAL function converts a text representation of a number in a given base into […]
Formula in cell C3:
'BASE' function examples
The following article has a formula that contains the BASE function.
This article demonstrates a macro that lets you create a list of permutations, repetitions are allowed, based on a number […]
Functions in 'Math and trigonometry' category
The BASE function function is one of many functions in the 'Math and trigonometry' category.
How to comment
How to add a formula to your comment
<code>Insert your formula here.</code>
Convert less than and larger than signs
Use html character entities instead of less than and larger than signs.
< becomes < and > becomes >
How to add VBA code to your comment
[vb 1="vbnet" language=","]
Put your VBA code here.
[/vb]
How to add a picture to your comment:
Upload picture to postimage.org or imgur
Paste image link to your comment.
Contact Oscar
You can contact me through this contact form