EXCEL - Binary to Decimal Worksheet

In summary, the conversation is about a difficult exercise involving converting a number from a specified base into decimal using Excel. The person asking the question is hoping for someone to explain the process to them. The conversation also includes information about using the TEXT and MID functions in Excel to extract and manipulate data. The person being asked for help stresses the importance of avoiding hard coding and suggests an expression using the LEN and Exponent functions.
  • #1
axellerate
4
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
  • #2
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:

Related to EXCEL - Binary to Decimal Worksheet

What is the purpose of the "EXCEL - Binary to Decimal Worksheet"?

The purpose of the "EXCEL - Binary to Decimal Worksheet" is to convert binary numbers to decimal numbers using Microsoft Excel.

What is the format of the "EXCEL - Binary to Decimal Worksheet"?

The "EXCEL - Binary to Decimal Worksheet" is a pre-made Excel spreadsheet with cells and formulas already set up for converting binary numbers to decimal numbers.

How accurate is the "EXCEL - Binary to Decimal Worksheet"?

The accuracy of the "EXCEL - Binary to Decimal Worksheet" depends on the accuracy of the binary numbers entered into the spreadsheet. As long as the binary numbers are entered correctly, the conversion to decimal numbers should be accurate.

Can the "EXCEL - Binary to Decimal Worksheet" be customized?

Yes, the "EXCEL - Binary to Decimal Worksheet" can be customized to fit specific needs. Users can add or remove columns and rows, change cell formatting, and adjust formulas to fit their requirements.

Is the "EXCEL - Binary to Decimal Worksheet" user-friendly?

The "EXCEL - Binary to Decimal Worksheet" is designed to be user-friendly, with clear instructions and easy-to-follow formulas. However, some basic knowledge of Excel may be required to use the worksheet effectively.

Similar threads

Replies
4
Views
976
  • Computing and Technology
Replies
4
Views
807
  • Engineering and Comp Sci Homework Help
Replies
11
Views
5K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
Replies
25
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
2K
  • Computing and Technology
Replies
4
Views
17K
  • Engineering and Comp Sci Homework Help
Replies
15
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
31
Views
4K
Back
Top