Users Guide To The Software Package Microsoft Excel

Total Page:16

File Type:pdf, Size:1020Kb

Users Guide To The Software Package Microsoft Excel

User Guide to the Software Package Microsoft Excel

What is Excel?

Excel is a versatile spreadsheet software package that allows the user to store databases, perform calculations, plot information, create programs, etc. The format of the software is very similar to Microsoft Word and very easy to learn. The information presented in this short manual will provide you with enough information to really begin using this software efficiently.

When you open Excel, you are immediately taken to the operating environment, as shown below: 1 2

3

4

The screen is divided into four primary sections.

1. Header: contains the drop-down folders File, Edit, View, Insert, etc. 2. Toolbar: contains icons for performing operations and is discussed in detail later. 3. Spreadsheet: area divided into rows (labeled 1,2,3…) and columns (labeled A,B,C…) where you can enter information (e.g. numbers or text). 4. Drawing Toolbar:

The length of the columns and width of the rows are set to an initial size, but these can be changed in the following ways:

 Right click on the column letter or row number. Select either “row height” or “column width” and enter the number you wish.  Under “Format” in the header, select either row or column.

Other options are available within the “Format” header. You can hide columns/rows or select “Autofit Selection” to change the cell to fit the entire information listed (an alternative is to place the mouse on the gray column letter and double click).

The drawing toolbar has icons identical to Word or Power Point that allow you to create shapes (squares, circles, and AutoShapes), arrows, lines, and text boxes. You can change the color of the drawings and text, as well as the colors of the spreadsheet cell entries and background.

Deleting Information and Shifting Columns/Rows:

If you have a set of information that you wish to delete or move, the following techniques can be used:

 Deleting single entries: left click the mouse on a desired cell and then press either Backspace or Delete.  Deleting multiple entries: if the information is next to one another, left click the mouse on the first cell, and holding the mouse drag it across the column or down the row to highlight the cells, and press Delete (Note: pressing Backspace will only erase the first cell you select). Alternatively you can select the first cell and holding the Shift key, left click the final cell. This will highlight every cell in between the two. You can then press Delete to erase the information. If the data you wish to erase is scattered in different cells, you can select them by holding the Control key and pressing the left mouse button on each cell you wish to select.  Deleting Rows/Colums: left click the mouse on the gray column or row index, and the right click the mouse and select Delete. Alternatively, you can select delete from the Edit header. If you wish to delete multiple rows or columns use the left mouse button in combination with the Shift or Control key to select groups or individual cells, respectively. (Note: if you wish to delete just the information in the entire column or row, then select the columns or rows and press Delete).  Copying and Pasting Cells: you can accomplish this by highlighting the cell(s) and pressing “Control+C” to copy and “Control+V” to paste. Or you can use the copy and paste options in the Edit header or the icons on the toolbar.

Special Features of the Header

Insert:  You can used the insert row or column features, but you must first select where you want to enter the row or column. Alternatively, you can use the right mouse key and select Insert.  Inserting worksheets. The tabs that you see at the bottom labeled “Sheet 1” etc. are called worksheets. They are a separate page and allow you to separate your information (e.g. if you are doing your homework, you could do problem 1 in Sheet 1 and problem 2 in another sheet). You can add worksheets in the Insert header. Also, you can change the name of the worksheet by right clicking on the tab or selecting Sheet>Rename from the Format header.  Graphs: you can select Chart to create a graph. The icon is a colored bar graph, which is more convenient to open in the toolbar. Details of graphing will be discussed later.  Function: the function option gives you a list of various functional operations in Excel. For example, you can use programming language (if, for, while statements), you can use mathematical operations (ln, log, exp), or you can use statistical functions that will calculate the standard deviation, average, etc. The function button also has an icon on the toolbar. The following are some examples:

LN() (natural logarithm), LOG() (base 10 logarithm), EXP(), “PI()” (the value of pi) AVERAGE() (gives you the average of selected cells), STDEV() (gives you the standard deviation of selected cells), SIN(), COS()…(input is in radians).

 Name: you can name cells. The name option in the Insert header allows you to name the cells. Alternatively, you can input the name in the white box on the header called “Name Box”. Advantages for using this option are the following: say you want to enter a temperature and use this value in various calculations. You can input your temperature in a cell and name the cell ‘T’. Then, every time you type ‘T’ it will reference that cell.

Format:  This folder allows you to change information on the cells, rows, columns, and worksheets.  Cells: you can change specifications on the cells by selecting Format>Cell, or you can right click the mouse on the selected cells you which to change. A screen opens that gives you several options (e.g. Number, Font, Border, Alignment). Under Number, you can specify the format of the numbers entered into the cell. For example, you can select “Percentage” and every number you enter will automatically have a percent sign. If you select “Number” or “Scientific” you can alter the number of decimal places printed in the cell.

Data:  Sort: this option allows you to select cells and arrange them in either ascending or descending order (either numerically or alphabetically). Note: this option is also available on the Toolbar.  Text to Columns: this option is extremely important when you copy numbers from an external file and paste them into Excel. Say you have information arranged in several columns in an output file on Wordpad. You copy the information and place it in Excel; however, Excel will place everything in one column. If your wish to separate the information, select the cells and then select Text to Columns. This will give you the option to separate by tabs, spaces, commas, etc. between the elements. Once you finish, it will properly separate the information into olumns. Toolbar: Icons appear on the toolbar that allow the user to access operations or commands easily. By placing the mouse on the icon, the operation name will appear to let you know what each icon represents. The Toolbar in Excel is very similar to Word, so the icons will not be discussed, but experiment with the Toolbar to become familiar with its the options.

Mathematical Operations

Excel is a great tool for performing multiple calculations, and the following information gives you some examples of the methodology of making mathematical calculations.

Example 1: You are given a function y(x)= 2x2+5 and you are asked to evaluate the function at values of x between 1 and 5. You would set up the following cells initially.

A B 1 x y 2 1 =2*A2^2+5

Note: If you are doing a calculation, you must have the “=” in front of the operation, otherwise you are just entering an expression. You can also select the cell and enter the equation in the Toolbar within the “Formula Bar”.

Notice in the table that the equation references cell A2 for the value of x. This can be done by typing A2 in the equation or left clicking cell A2 with the mouse.

You would then enter a second value:

A B 1 x y 2 1 =2*A2^2+5 3 =A2+1 =2*A3^2+5

There are several tricks that can be used. First, if you have a long list of numbers (e.g. 1,2,3,4…) you can enter the first and set up an equation where the next cell will reference the last. So cell A3 has the equation A2+1. If you copy cell A3 and paste it in cell A4, Excel will automatically change the equation to A3+1. You can copy this cell and paste it to cell A100 and you’ll get a list of numbers 1,2,3,4,…99. The same applies to the y equation. If you copy cell B2 and place it in cell A3, the formula will automatically change to 2*A3^2+5, as shown above. This is what makes Excel such a powerful tool. You can evaluate y(x) for thousands of x-values in a matter of seconds by copy and pasting cells.

Note: There is a very convenient way to copy the cell. If you select the cell and place the mouse at the bottom right corner of the cell, the mouse icon will turn into a small “+” sign. Once you have reached the bottom corner, simply left click the mouse and drag down the column. It will take that information and copy it to the other cells. You can also drag the information across the row. Example 2: Plotting In Excel

Let’s say you have generated a number of points from Example 1 and you now wish to plot y(x) vs. x. You start by clicking the bar graph icon in the Toolbox (or Insert>Chart in the Header). A screen will open that gives you several options. The Chart Type chooses what type of graph you wish to generate. Unless you are doing statistical plots, always select “XY(scatter)”. Once you select this, Chart Subtypes will appear on the right. You can simply plot the points, connect the points with smooth or straight lines, or plot the curves without the points. For this example, select to plot the points (it should be set to this option on default).

 Press “Next” and you will enter the Source Data page. Click on the “Series” tab at the top left corner.  Click “Add” Series. If you wish, you can enter the name of the series (this is used in the graph legend). In “X Values” click the right icon and the screen will temporarily disappear. Go to the cells that contain the x values in the spreadsheet and highlight all of the cells. This will bring back the graph screen and the x-points will automatically be entered. Repeat this process for the y-values. (Note: if you wish to place several plots on the same graph, simply click “Add” Series and you can enter other x-y data points along with their respective names).  Click “Next” and you are given a screen with several tabs that allow you to manipulate the graph. All engineering graphs should have labels on both the x and y axes, INCLUDING UNITS! (In this example, we are plotting pure numbers, so there are no units.)  Click “Next” and you are given the option to place a small graph in the Worksheet or create a new worksheet with a large graph. (Note: if you choose to place the graph in its own worksheet, you can name it by erasing “Chart 1” and entering the new name).  Clicking “Finish” will place the graph in the appropriate location you selected.

Once the graph is generated you can manipulate several aspects. Double clicking on the graph will allow you to change background colors or borders. Right clicking the graph (or selecting Chart from the header) will allow you to select from the previous screens (Chart Type, Source Data, Chart Options, Location). Double clicking on the axes will bring up a screen that allows you to change the number (e.g. scientific to number), alter the font, and more importantly change the scale (e.g. maximum/minimum x-value, logarithmic scale, etc.).

Special Feature:

Click the mouse once on the graph to select it, then choose “Chart” in the header. Select the option “Add Trendline.” Using this option, you can fit data to various types of curves. If you wish to place the resulting fitted equation and R2 value, you must select “Display equation on chart” and “Display R-squared value on chart” under the “Options” tab, which is locate at the top left corner of the screen.

A finished copy of the plot of y(x) from x=-10,10 is shown in the following figure. Plot of y(x)=2x^2+5

250

200

150 ) x ( y 100

50

0 -15 -10 -5 0 5 10 15 x

Example 3: Calculating Reaction Rate Constants vs. Temperature

The following information is provided for a first-order reaction. k=Aexp(-EA/(RT))

EA=100 KJ/mole A=1.2 x 1010 s-1

You wish to plot the rate constant, k, for this reaction as a function of temperature between 300- 400 K.

The Excel sheet would have the following format:

A B C 1 EA 100000 J/mole 2 A =1.2*10^10 3 4 T (K) k 5 300 =$B$2*EXP(-$B$1/(8.314*A5)) 6 =A5+10 =$B$2*EXP(-$B$1/(8.314*A6)) 7 =A6+10 =$B$2*EXP(-$B$1/(8.314*A7)) 8 =A7+10 =$B$2*EXP(-$B$1/(8.314*A8)) 9 =A8+10 =$B$2*EXP(-$B$1/(8.314*A9)) 10 =A9+10 =$B$2*EXP(-$B$1/(8.314*A10)) 11 =A10+10 =$B$2*EXP(-$B$1/(8.314*A11)) 12 =A11+10 =$B$2*EXP(-$B$1/(8.314*A12)) 13 There are several points to make:

 The symbol “$” holds the value constant (e.g. $B2 will hold the column constant at B, B$2 will hold the row at 2, and $B$2 will always call cell B2). If you have a constant that you want to continually reference (e.g. EA), you enter the number in the cell and reference it as follows “$B$1”. Alternatively, you can name the cell as mentioned previously (e.g. you can name the cell EA and every time you type “EA” it will reference that cell).  In the table, you enter the equation in cell B5 and copy that cell down to B12.  You generate multiple temperatures by entering the equation, as shown in cell B6, and copy that cell down the remaining columns. In this case, temperatures were generated in intervals of 10 K.

Example 4: Finding the Roots of an Equation

Say you are given the equation f(x) = x2-x-6 = 0 and you wish to solve the roots. Now in this case, we know that x=3,-2 are the two roots; however, if you have complex equations Excel has an excellent feature that will solve the roots. Under Tools in the Header is “Goal Seek” which uses Newton’s method to evaluate the roots of a function. This is how you would set up the problem.

Generate the following spreadsheet:

A B 1 x f(x) 2 0.5 =A2^2-A2-6

You create a cell for the equation and a value for x. Since we don’t know the root, you must make an initial guess. In this case we put x=0.5. Next, select cell B2 and then select Goal Seek under the Tools header. A screen will open that requires three sets of information. The first is “Set Cell” which is already selected to B2. You must now enter “0” next to “To Value”. This will set cell B2 equal to zero. Next, click the mouse in “By Changing Cell” and select cell A2 by left clicking the cell on the spreadsheet. Then hit enter. A screen opens that gives you the following information: the target value and current value. We set the target value equal to zero and the output tells us that the current value is –6.6e-6, which is approximately zero. Click Enter and the value in cell A2 is now “2.99999”. Note that this only gives us one of the roots, and the value is the approximate root. The initial guess is extremely important!!! For instance, if you enter –5 in cell A2 and perform Goal Seek, the result will be –2.0001.

Example 5: Fitting a Straight Line to Experimental Data

Here, we want to find the Henry’s Law constant from some experimental data. The Henry’s Law constant, kH, relates the weight fraction of a gas dissolved in a liquid, wgas, to the partial pressure P of the gas that is in equilibrium with the liquid, i.e., wgas = kH P Below are experimental data on the weight fraction of carbon dioxide dissolved in poly(vinyl acetate) liquid, as a function of CO2 partial pressure:

A B

1 Pressure wgas 2 (MPa) 3 2.263 0.053 4 4.104 0.098 5 6.010 0.146 6 7.772 0.193 7 9.694 0.249

Enter the data in Excel, and plot the data as an x,y scatter plot, following Example 2 above. Then, insert the plot into your spreadsheet, and do the following to fit a line to the data (and determine kH):

 Right click on any one of the data points in the graph. Click “Add Trendline.”  Select the Linear plot (this is the default, and will be highlighted in black).  Next, click the Options tag, and check the 3 boxes at the bottom (Set intercept = 0, Display equation on chart, and Display R-squared value on chart). In this particular case, we know that there will be NO CO2 in the liquid when there is no CO2 gas present (i.e., when P=0), so we will force the curve fit to go through the origin.

The best fit line through the data will be displayed on the chart (y=0.025x). The slope of the line is the Henry’s law constant kH. (What are its units?)

Hint: If you want Excel to report more significant figures, you can multiply all the wgas values by 100 before plotting them. But then you have to remember to divide the slope by 100 to get the true Henry’s constant.

Recommended publications