EXCEL - Binary to Decimal Worksheet

  • Thread starter Thread starter axellerate
  • Start date Start date
  • Tags Tags
    Binary Excel
Click For Summary
SUMMARY

The forum discussion focuses on creating a worksheet in Excel to convert binary numbers to decimal format using specific formulas. Key functions mentioned include TEXT for formatting inputs to eight digits and MID for extracting individual characters from a string. The discussion emphasizes the importance of avoiding hard-coded values in formulas, instead suggesting the use of dynamic calculations based on the length of the string and a descending sequence of integers. The final goal is to compute the decimal value by multiplying the base raised to the exponents and summing the results.

PREREQUISITES
  • Proficiency in Excel functions, specifically TEXT and MID
  • Understanding of binary and decimal number systems
  • Familiarity with Excel formula syntax and dynamic referencing
  • Knowledge of string manipulation in Excel
NEXT STEPS
  • Research how to use the LEN function in Excel for string length calculations
  • Learn about dynamic cell referencing in Excel to avoid hard-coded values
  • Explore advanced Excel functions for data manipulation, such as CONCATENATE and VALUE
  • Study the process of converting numbers from different bases using Excel formulas
USEFUL FOR

This discussion is beneficial for students learning Excel, educators teaching data manipulation, and anyone interested in automating number base conversions in spreadsheets.

axellerate
Messages
4
Reaction score
0
Ok, this one exercise is really getting to me. Either I missed something, or our prof hasn't gone over any of this. I was hoping someone could decode this for me.

Question:

____________________________________________________________________________



[PLAIN]http://img829.imageshack.us/img829/996/screenshot20111019at618.png


The Base cell is used to specify the base of the number that will be Input. When values are entered in the cells the sheet converts from the base specified into Decimal. To do this you will need several formulae.

Normal form is required because Excel will ignore any leading zeroes in the Input. To guarantee that the number has 8 digits it will be necessary to convert it to a string and pad the left end with 0’s as necessary. This can all be accomplished with the TEXT function.
TEXT (value, format_text)
value is a numeric value, a formula that evaluates to a numeric value, or a reference to a cell containing a numeric value.
format_text is a number format in text form from the Category box on the Number tab in the Format Cells dialog box.
For our purposes we can specify exactly 8 digits using the format specification: “00000000”. The formula for Normal form then is:
= TEXT (Input, “00000000”)
Now that the data is in Normal_form we can create a single formula to extract each digit and place it in the appropriate cell in the range named bit. This formula requires some thought. How can Excel copy characters from a string into different cells? The key to the answer is in the fact that the digits are characters. We can therefore use a TEXT function. The formula will be located in cells C7 through J7. In C7 it needs to select the first character from Normal_form, while in D7 it needs to select the second character, etc. The MID function looks like the best choice.


We know the name of the string and the number of characters needed so the formula will resemble this one:
=MID (Normal_form, start_position, 1)

Of course, the calculation of start_position is still the key.

You might be tempted to simply replace start_position with an integer: 1 in cell C7, 2 in D7, etc. But this is clearly NOT the best way to handle the task. Hard coding literal values in formulae is generally a bad idea. What’s needed is an expression that will generate the appropriate sequence of digits, namely 1 in C7, 2 in D7, etc.

As it turns out, we have a descending sequence of integers just above in the Exponent row. Subtracting a descending sequence from the length of the string will produce the numbers we need. This part can be accomplished with
LEN (Normal_form) – Exponent
So substitute this expression for start_position to complete the formula.

You will also need to write a formula to calculate the cells in the value range. These values are simply the Base raised to the Exponents.

With the value and bit ranges defined you can multiply them together to get the extension values and SUM these to get Decimal.

____________________________________________________________________________


Any help is appreciated.
 
Last edited by a moderator:
Physics news on Phys.org
axellerate said:
Ok, this one exercise is really getting to me. Either I missed something, or our prof hasn't gone over any of this. I was hoping someone could decode this for me.

Question:

____________________________________________________________________________



[PLAIN]http://img829.imageshack.us/img829/996/screenshot20111019at618.png


The Base cell is used to specify the base of the number that will be Input. When values are entered in the cells the sheet converts from the base specified into Decimal. To do this you will need several formulae.

Normal form is required because Excel will ignore any leading zeroes in the Input. To guarantee that the number has 8 digits it will be necessary to convert it to a string and pad the left end with 0’s as necessary. This can all be accomplished with the TEXT function.
TEXT (value, format_text)
value is a numeric value, a formula that evaluates to a numeric value, or a reference to a cell containing a numeric value.
format_text is a number format in text form from the Category box on the Number tab in the Format Cells dialog box.
For our purposes we can specify exactly 8 digits using the format specification: “00000000”. The formula for Normal form then is:
= TEXT (Input, “00000000”)
Now that the data is in Normal_form we can create a single formula to extract each digit and place it in the appropriate cell in the range named bit. This formula requires some thought. How can Excel copy characters from a string into different cells? The key to the answer is in the fact that the digits are characters. We can therefore use a TEXT function. The formula will be located in cells C7 through J7. In C7 it needs to select the first character from Normal_form, while in D7 it needs to select the second character, etc. The MID function looks like the best choice.


We know the name of the string and the number of characters needed so the formula will resemble this one:
=MID (Normal_form, start_position, 1)

Of course, the calculation of start_position is still the key.

You might be tempted to simply replace start_position with an integer: 1 in cell C7, 2 in D7, etc. But this is clearly NOT the best way to handle the task. Hard coding literal values in formulae is generally a bad idea. What’s needed is an expression that will generate the appropriate sequence of digits, namely 1 in C7, 2 in D7, etc.

As it turns out, we have a descending sequence of integers just above in the Exponent row. Subtracting a descending sequence from the length of the string will produce the numbers we need. This part can be accomplished with
LEN (Normal_form) – Exponent
So substitute this expression for start_position to complete the formula.

You will also need to write a formula to calculate the cells in the value range. These values are simply the Base raised to the Exponents.

With the value and bit ranges defined you can multiply them together to get the extension values and SUM these to get Decimal.

____________________________________________________________________________


Any help is appreciated.

We don't do your schoolwork for you here on the PF. What are your thoughts on how to proceed? Have you done the first couple of conversion formulas? What do they look like?
 
Last edited by a moderator:

Similar threads

Replies
17
Views
1K
Replies
11
Views
6K
  • · Replies 2 ·
Replies
2
Views
18K
Replies
4
Views
2K
  • · Replies 8 ·
Replies
8
Views
7K
  • · Replies 3 ·
Replies
3
Views
19K
Replies
25
Views
4K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 15 ·
Replies
15
Views
3K