Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 9

Programming for Engineers I

Week 3, Lab 3

E010110 PRORAMMING FOR ENGINEERS I


LAB 3
FALL 2012

OBJECTIVE
Introduction to Microsoft Excel and its basic functionalities are explained. You would be required to show lab tasks at the end of the lab to your lab instructor.

MS EXCEL INTRODUCTION
Microsoft Excel (or just plain old Excel) is a spreadsheet application. Spreadsheets are ways to organize data by grouping it into rows and columns. They are used for many jobs, ranging from accounting to insurance to engineering. Excel is a good program for these types of applications because it is an easy program to learn and use.

VOCABULARY
Cell - the small boxes where data exists in a spreadsheet Function - just like in math, an operation performed on variables or constants

STARTING EXCEL
ENTERING THE DATA
Open MS Excel 2007 Click the cell in which you want to enter data; this will select the cell, and the word Rea dy appears in the status bar. [The selected cell is also called active cell] Type the text or number. As you type, the word Enter appears in the status bar and the typed data appears both in the cell and in the Formula bar. Press Enter to accept the data. You can also press Tab to enter the data and move to th e next cell to the right or one of the Arrow keys to enter the data and move to the next cell in the di rection of the arrow key pressed.

Fall 2 012

Programming for Engineers I

Week 3, Lab 3

Enter data into the cells as shown in the figure [first four rows] Select the four rows of data entered, copy the rows (like in MS Word, Ctrl + C), click o n the first cell of row 5 and paste the data (just like in MS Word)

FORMATTING CELLS
The first thing we want to do is format our cells to make the information easier to und erstand and more standardized. Formatting the Date Select all of column A by clicking on the "A" at the top of the column. With this column still highlighted, select the Format Cells.. option from the Format menu in the Cells section of the Home ribbon. You can also access this option by rightclicking on the column header and selecting it from the menu that appears. We are working with dates here, so select the "Date" category under the Numbers tab. Under this option are many varieties of date formats. Select "03/14/01". Click OK. You should now see all of the dates in the form xx/xx/xx.
Fall 2012

Programming for Engineers I ADDING OR REMOVING RO WS OR COLUMNS


There is a column of data that, t o be honest, we are not sure we want . That is column G. To delete that column: Select column G. In the Cells section of the Home ribbon, select "Delete Cells" from the Delete menu. You can also rightclick on the column header and select "Delete" from the resulting menu.

Week 3, Lab 3

The next thing we begin to notice is that we have forgotten what all of the various data in the columns is. We can pick out the dates and volume easily enough but the open and closi ng and high and low prices are lost to us. To remedy this, we want to add a header row. To add a hea der row: Select the first row. (Select the "1" on the left side of the screen.) In the Cells section of the Home ribbon, select "Insert Cells" from the Insert menu. You can also rightclick on the column header and select "Insert" from the resulting menu.

You should now have a blank row at the top of the work book. Enter the names of each column - Date, High, Low, Average, Close & Volume

FORMULAS
A formula is an algebraic expression using numbers, functions, mathematical operators, and cell addresses that tell Excel what operations to perform on numbers or the contents of the

referenced cells. All formulas in Excel must begin with an equal sign (=). Then formula is written which is displayed in the formula bar. Result of the calculated formula is displayed in the actual cel l. In the last empty cell of Column F (Volume), Type = followed by AVERAGE. As you type, Excel will auto complete the formula with suggestions. This formula will calculate average.
Fall 2012

Programming for Engineers I


To complete the formula, data range must also be prov ided to calculate average for complete the formula as: AVERAGE(F2:F9) and press Enter. F2:F9 gives a range o f data to Excel of which average is to be computed. Changing the number in any of the cells in range F2:F9, the value of F10 is automatically recalculated

Week 3, Lab 3

GRAPHING
Since we are dealing with stock data and we are used to seeing that data in charts and graphs, let us make a gr aph. Select all of the data in column F except the first row In the Insert Ribbon, choose Column from the Charts section and select the "3D Clustered Column" option. A column chart should now appear on your spreadsheet. Click on an edge an d drag it to one side so that it doesn't overlap any of your columns of numbers. COPYING OTHER CELLS A FORMULA TO

Worksheets frequently use similar formulas across rows or down columns. There is no need to enter each formula separately; just copy the formula from one cell to another. Copy the formula entered in F10 to cell E10 and notice it calculates average of data fro m E2 to E9 and it calculates the average for data entered in column E.

FORMATING TEXT
You can format data in Excel just like Microsoft Word. Select the first row, where column names are written and in the Home Ribbon, Click on the Bold button. Do similar operation for the averages calculated in the 10th row.

LAB TASKS
1. Start Excel by clicking its icon from the Start\Programs\Excel. Enter the following da ta into your spreadsheet:

Fall 2012

Programming for Engineers I


A 1 Course 2 CS101 3 PHY101 4 MT101 5 EE101 6 7 8 B Credit 4 4 3 4 C Grade A B A C D Worth 4 3 4 2 Total Credit x Worth Total Credit GPA E Credit x Worth F

Week 3, Lab 3
G

Course should be in cell A1. 2. Enter the formula in Credit x Worth column which would multiply the data entered in Credit and Worth for that row.

3. Copy the formula across all rows with courses. 4. In column G of row 6, enter formula to Sum the data from E2 to E5. (Hint: Formula Sum) 5. In column G of row 7, enter formula to Sum the data from B2 to B5 6. To calculate GPA, enter formula in G8 to divide G6 over G7 Calculated GPA will be of the form X.XXXXX with more than two numbers after the decimal. 7. Change the formatting of the cell G8 (just like you changed the formatting of Column A earlier in the lab) to have only two digits after the decimal. (Hint: Look at the Number Category) 8. Insert a Pie chart into your worksheet to show the effect of each course on your GPA. To do this you should select A2:A5 and then (by pressing Ctrl key) E2:E5 and then insert the chart. The chart will show what the percentage effect of each course grade has on your GPA. The effect depends on both the credit of the course and your grade.

Fall 2012

You might also like