BASE


Returns a text representation of a number, in a specified base radix.

Syntax:

BASE(number, radix, minlength)


converts number (a positive integer) to text, with the base radix radix (an integer between 2 and 36), using characters 0-9 and A-Z.

minlength (optional) specifies the minimum number of characters returned; zeroes are added on the left if necessary.

Example:

BASE(17, 2)

returns 10001 as text (binary system).

BASE(17, 10)

returns 17 as text (decimal system).

BASE(255, 16, 4)

returns 00FF as text (hexadecimal system). Extra zeroes are added to give 4 characters.

ISTEXT(BASE(17, 10))

returns TRUE. Text is returned, not a number.


Application:

Converting Data for a Legacy System

Imagine you are a data analyst at a small manufacturing company. Your company has recently acquired a new set of sensors for its production line. These sensors measure a variety of metrics, but their data output is in decimal (base-10) format. The legacy control system, however, can only process and display data in hexadecimal (base-16) format.

Scenario

You have a list of temperature readings from a sensor, and you need to create a conversion table to send to the legacy system administrator.

The BASE Function

The BASE function has the following syntax:

BASE(Number, Radix, [Min_length])

  • Number: The number you want to convert (in this case, the decimal temperature reading).
  • Radix: The base you want to convert to (in this case, 16 for hexadecimal).
  • [Min_length]: (Optional) The minimum number of characters for the returned string. This is useful for ensuring data is padded with leading zeros, which is often required by legacy systems.


The Table

Decimal Temperature

Hexadecimal Temperature

Result from Formula

A
B
C
1
120
78
78
2
165
A5
A5
3
255
FF
FF
4
10
A
A
5
256
100
100
6
85
55
55

Explanation:

  • Column A: Decimal Temperature: This column contains the raw data from the new sensors.
  • Column B: Hexadecimal Temperature: This column shows the result of the conversion. This is the data that will be fed into the legacy system.
  • Column C: Formula: This column shows the BASE function in action. For each row, the formula takes the decimal value from column A and converts it to its hexadecimal equivalent. For example, in the first row, BASE(120, 16) converts the decimal number 120 into the hexadecimal string "78".


The formula column is where you would input the BASE function, and the results column is where the output of that function is displayed. Here’s a detailed breakdown of how it works for each row in the table:

Row 1:

  • Decimal Temperature (A1): 120
  • Formula (C1): BASE(A1, 16)
  • Explanation: The formula tells the spreadsheet to take the number in cell A1 (which is 120) and convert it to a base-16 number (hexadecimal).
  • Result (B1): 78. This is the hexadecimal representation of the decimal number 120.


Row 2:

  • Decimal Temperature (A2): 165
  • Formula (C2): BASE(A2, 16)
  • Explanation: The formula takes the number in cell A2 (165) and converts it to a base-16 number.
  • Result (B2): A5. This is the hexadecimal representation of the decimal number 165.


Row 3:

  • Decimal Temperature (A3): 255
  • Formula (C3): BASE(A3, 16)
  • Explanation: The formula takes the number in cell A3 (255) and converts it to a base-16 number.
  • Result (B3): FF. This is the hexadecimal representation of the decimal number 255.


Row 4:

  • Decimal Temperature (A4): 10
  • Formula (C4): BASE(A4, 16)
  • Explanation: The formula takes the number in cell A4 (10) and converts it to a base-16 number.
  • Result (B4): A. In hexadecimal, the number 10 is represented by the letter A.


Row 5:

  • Decimal Temperature (A5): 256
  • Formula (C5): BASE(A5, 16)
  • Explanation: The formula takes the number in cell A5 (256) and converts it to a base-16 number.
  • Result (B5): 100. This is the hexadecimal representation of the decimal number 256.


Row 6:

  • Decimal Temperature (A6): 85
  • Formula (C6): BASE(A6, 16)
  • Explanation: The formula takes the number in cell A6 (85) and converts it to a base-16 number.
  • Result (B6): 55. This is the hexadecimal representation of the decimal number 85.




This page is protected by Google reCAPTCHA. Privacy - Terms.
 
Built using Zapof