CIVE 1331 COMPUTING FOR ENGINEEERS
LAB 5 - Excel Fundamentals




1. Introduction.

The objective of this lab is to give you a working knowledge of 
Excel fundamentals.


2. Instructions.

In the Spreadsheet Tools for Engineers book, do the following 
exercises:

2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 2.10, 2.11, 2.12


3. Deliverables.

Write up a short report for this lab.  Include a printout of
 the worksheet area which contains the data for each of the
 exercise.  If one of the exercises simply modifies one of the
 earlier sheets, you only need to include a printout of the 
latter sheet.  For example, Exercise 2.4 only modifies the sheet
 from Exercise 2.3 so only include a sheet of the latter problem
 (Exercise 2.4).  In your report, you may put Exercise 2.3 and 
2.4:  See printout of worksheet in Appendix.  

Some of the exercises may ask you questions such as what is 
the formula for the value in cell C10 of Figure 2.4?  Your 
write-up should include the answer for these questions.  The
 report should include a summary of the lab and a hard copy
 of each worksheet (as explained above).  Submit your report
 to the TA prior at the next lab meeting.

Functions and Printing in Excel

We discussed last lecture some of the basic operations in 
Spreadsheets such as adding, subtraction, multiplication, 
and division.  While we can usually input equations to accomplish
 many of the operations that we wish to complete, in many 
situations we may wish to use some of the Functions already 
in Excel.  The Excel functions can be found by selecting the 
fx  button on the main toolbar.  A pop-up panel will appear
 from which you may select from an assortment of different 
function categories.  In many situations it will just be 
easier to select the All category which will then display 
all of the Excel functions alphabetically.  

In general, there are several ways that you can use to accomplish 
a given goal.  The Excel functions will save you quite a bit of 
time instead of inputting equations to accomplish the same goal. 
 For example, say that we have a column of numbers and we wish to
 obtain the average value.  
	A	B

5		10
6		14
7		13
8		21
9		17

One method to obtain the average would be to add the numbers:  
 =(B5+B6+B7+B8+B9)/5

An easier method would be to use the SUM function in Excel. 
 If you select the SUM function from the fx panel, you will 
be stepped through the function.  
The resulting expression will be =SUM(B5:B9)/5

The easiest method to obtain the average number is to use the
 AVERAGE function:
=AVERAGE(B5:B9)

There are several functions within Excel which you will find useful.  

Printing in Excel

You can set the printing options on Excel by selecting the Page
 Setup under the File Menu or change the options directly in the
 Print Option.  In most situations you will probably want to print 
a certain part of a sheet.  The best way to do this is to select 
the area that you wish to print, and select Print from under the 
File Menu.  A pop-up panel will appear from which you should choose
 Selection from under the Print What option.  You may also wish to
 preview the material that you will be printing - select the 
Preview button at the bottom left corner of the pop-up panel. 
 A preview of the printed page will appear.  You can also select
 Setup from this page to change the page layout from Portrait to 
 Landscape or to add a Header or  Footer.  

Matrix Operations in MS Excel:

We’ve discussed basic matrix operations such as addition,
subtraction, and multiplication.  Excel can be used to carry
 out operations on matrices.  

For example, say we want to add two matrices A + B = C:
						(by hand)
	A Matrix:		B Matrix:	C Matrix
	1	-2		-5	6	4	4
	3	-4		7	-8	10	-12

1.  Enter the matrices A and B into the Excel sheet.
2.  Highlight the region of the sheet that you want the resulting
 matrix C to be placed.  In this case we know C will be 2 x 2 so
 we highlight some 2 x 2 area.
3.  The working cell will be the upper left of the highlighted 
cells.  Enter the operations to be performed:
			=C5:D6 + G5:H6
4.  When the expression has been entered, simultaneously holddown 
the control (Ctrl) key, the shift key while pressing the Enter
 key.  This tells Excel that this is a matrix operation, and it
 will automatically place brackets around the expression:  
{=C5:D6+G5:H6}

Matrix Multiplication:


Excel has a built in command for matrix multiplication.  The 
form of the command has the form:

				MMULT(array1,array2)

After the command has been typed in, hold down control and shift
 keys while depressing the enter key.  

For example: 						(by hand)
	A matrix:		B Matrix:		C Matrix:
	1	-2		-5	6		-19	22
	3	-4		7	-8		-43	50

1.  Say that the matrix A is in cells C10:D11 and the matrix B 
is in Cells G10:H11.  We first highlight the cells that we want
 to place the matrix C.  It will require the same number of rows
 as A and the same number of columns as B.
 
2.  Once we have highlighted the cells (a 2 x 2 area in this case),
 we can begin entering the equation.  The active cell is the upper
 left cell of the highlighted area.  We enter the equation:
			=MMULT(C10:D11,G10:H11)

3.  After we have typed in the equation we hold down the Ctrl 
and Shift key while depressing the Enter key.  This tells Excel
that this is a matrix operation.  The resulting equation becomes:	
{=MMULT(C10:D11,G10:H11)}
 
4.    The resulting C matrix will be in the highlighted cells.  

Matrix Inversion:

Excel also has a built in command for finding the inverse of a matrix. The command has the form: MINVERSE(array) After the command has been typed in, hold down control and shift keys while depressing the enter key. For example: (Last class we considered this matrix) A matrix: A-1 Matrix 2 3 +1/6 +1/6 4 -3 +2/9 -1/9 1. Say that the matrix A is in cells C15:D16 : 2. Once we have highlighted the cells (a 2 x 2 area in this case), we can begin entering the equation. The active cell is the upper left cell of the highlighted area. We enter the equation: =MINVERSE(C15:D16) 3. After we have typed in the equation we hold down the Ctrl and Shift key while depressing the Enter key. This tells Excel that this is a matrix operation. The resulting equation becomes: {=MINVERSE(C15:D16)} 4. The resulting A-1 matrix will be in the highlighted cells. Solving Systems of Equations: We can use the above concepts in Excel to solve a simultaneous system of linear equations: AX=B Recall that last class we showed that by using the concept of the inverse of the matrix A we can write: A-1 A X = A-1 B IX = X = A-1 B Last class we used the system of equations: 2x1+3x2 = 8 4x1 - 3x2 = -2 For this example:A matrix B matrix 2 3 8 4 -3 -2 We have already calculated the inverse of the A matrix, so all we have to do is multiply A-1 B to solve for the unknowns X (x1, x2). Using Excel: 1. Enter the A and B matrices into the appropriate cells. 2. Find the inverse of the A matrix. 3. Multiply the A-1 and the B matrix to solve for the unknowns X. The results may be checked by plugging the values of X into the original equations and checking that AX = B.