APCO / IASC 1P01 – Lab 1 Student Name _________________________ Lab Leader ____________________________ Student # ______________________________ Date __________________________________ Please follow all instructions on the following pages. You will learn different features of Excel by creating two different worksheets. Simply show (and demonstrate, if necessary) your completed worksheets to the lab leader, and if all tasks are fully completed, you will immediately be awarded the full grade. Please show your laboratory supervisor during your scheduled lab time. Your lab leader will have a sheet containing all names registered for that lab. This requires that you attend only the lab for which you are registered, and that you be finished by your third lab (week of Oct 7th to Oct 11th). For your own records, make sure that the first page is filled out and that your lab leader has signed it as proof that you have completed the lab. Excel Overview: Start Microsoft Excel. You should be immediately presented with a blank workbook, but if not, click New under the File menu. 1. Note that there are several tabbed groups for different types of options in the toolbar. Currently, the Home group is selected. If you choose a different group (e.g. Data), it will replace all of the buttons on the toolbar. 2. A single workbook (analogous to a file) may hold multiple worksheets. For this lab, since both Part A and Part B are related (by virtue of being part of the same assignment), they’re included in the same workbook, but are found on different worksheets. Worksheets should be renamed (to something more task-‐specific than Sheet1, Sheet2, etc). 3. Across the top are the labels for 256 columns. Columns are identified alphabetically. Columns are labeled (A..Z, AA..AZ, BA...BZ, ….., ZA….ZZ) 4. Across the left side are the labels for rows, which are numbered from 1 to 65,536. 5. By combining the intersection of a column index and a row index, we can specify an individual cell. For instance, the intersection of column C and row 4 will be cell C4. 6. The Name Box (above column A) has two functions. First, if you type in the index of a cell, it will scroll the view to that cell and select it. Second, it can be used to assign convenient names to individual cells (will not apply to this lab). 7. The formula bar is used to edit the information within a single cell. This can mean simply entering a number, or specifying a mathematical/logical operation to create the information that should be displayed in that cell. 8. Whenever a cell is selected (or cells are selected), the selection has a small handle in the lower-‐right corner. This allows you to quickly and easily extend series of data across larger ranges. 9. Though there are more complete controls under the View tab group, there are also three buttons in the bottom right corner (beside the zoom slider) that let you quickly see your spreadsheet. Among other things, this can be an easy way to quickly preview how a document will look when you hit Print. 2 Part A 1. For Part A, you simply need to reproduce the following table, including formatting: Note that: • All values were entered as plain numbers (e.g. 71, 200, 26, 7.5), with cell formatting taking care of the rest. • The title is properly horizontally-‐centred in the middle of the table, and would still be centred if the relevant columns were resized. Enter all of the information as shown in the provided picture, with the following exceptions: • Don’t worry about making the title appear centred or as a single cell yet • Do not try to get the decimal showing in column E yet • Do not worry about the quotation marks (for inches) after the numbers in column B • Do not concern yourself with colouring/formatting Now that you have that done, let’s look at each of the remaining components in sequence: ‘ • Getting the title centred o If you move the mouse cursor over cell A1, hold down the left mouse button, slide the cursor over to E1, and release the mouse button. You will see that you have selected all of the cells you wish to use for the title. Alternatively, if A1 was already selected, you could have held down the Shift key, pressed the right arrow key four times, and released the Shift key. o Like many things in Microsoft Office, there are multiple ways to accomplish the next step. In the Home tab group, there is a button called Merge & Center. Clicking this button does what we need. o An alternate approach to using that button is to right-‐click anywhere within the selected cells, choose Format Cells…, select the Alignment tab, and then check Merge cells, and choose Center from Horizontal. • Showing the values within column E as decimal values with a single decimal digit… o Select the cells in the range E3:E6. o Right-‐click the selection, choose Format Cells…, and choose the Number tab. o The different categories you see on the left reflect the various different styles of premade data-‐ formatting available to you. Each category consists of multiple variations. Choose Number. o There are typically four variations of Number displayed in the right panel. Each is based on a different method of distinguishing between positive and negative numbers. If the first and third look identical to you, it’s because they both display negative values the same. However, the latter also adds a space after positive values to make them line up slightly better with negative values. o The first option is nearly perfect for us, with one exception: It will always display precisely two decimal values. We only want one. This is both easy and intuitive to fix: there’s a widget for the number of decimal places to use (set to 2 by default). Change that to 1. APCO 1P01 Fall 2013 – Lab 1 3 • Showing the values within column B as inches (appending “ to each value)… o Technically, you could simply type 71” instead of 71 into cell B3. However, the problem is that, if you ever wanted to use that value as a number (in a formula), you would be unable to do so. Rather, the entry would be treated as text. o o o We want it to still be a number (i.e. still just 71), but appear to have some text added. Select cells B3:B6, right-‐click the selection, and choose Format Cells…. Once again choose the Number tab (if it isn’t already selected). Choose the Custom option on the left. All of the different formatting options actually follow deterministic (i.e. predictable and repeatable) rules. In the right panel, you can see the expressions that generate some common (or recent) formats. Instead of the default of General, enter 000 beside Type. You’ll see that this means it always displays precisely three digits to the left of the decimal point, and none to the right. Try entering # instead. It looks like it’s back to normal, right? Temporarily set the player’s height to 0. The quick explanation is that it’s setting significant digits (and thus, 0 will be left blank). Now try #,##0 and see the result. Try changing one of the values to a decimal (e.g. 71.5). You’ll see that it can’t use decimal values, since we didn’t explicitly allow for them. This time, try changing it to #,##0”inches” and see what you get. It’s very close, isn’t it? The only problem is that we want to display the “ symbol, not inches. However, you may have noticed that we use the “ symbol to mark the beginning and the end of a piece of text. This means that, if we were to enter #,##0” it would think that it was incomplete, because Excel wouldn’t know that “ is the text. What we need is what’s known as an escape character. An escape character is a special character that says, “treat the next character differently from how you normally would.” The escape character varies from program to program on which character that it is. For Excel, the escape character is the backslash. Try entering #,##0\” and see what you get! • Colouring/formatting… o You could simply select each cell, right-‐click, choose Format Cells…, and manually change all of the font faces and backgrounds. However, If available, Styles are easier for you to use. o If you are using a PC, Try selecting the title cell and choose the Home tab group. See the Styles area on the toolbar? Click on Cell Styles. What you’ll get is a handy selection of commonly-‐used styles within the current theme. For the title, try Accent1 (note: your specific results may vary depending on version. What matters is that you use different styles for the different areas shown in the sample picture; not which ones you choose). o Repeat the above process with the different areas, and with different styles, and you’ll end up with the same result as shown. APCO 1P01 Fall 2013 – Lab 1 4 Part B The local Skating Club is having a fundraiser. They are selling cookie dough and packages of individual pizzas to raise money for the club. Numbers shown with orange or grey backgrounds must be calculated. Format cells appropriately (e.g. currency). The `winner’ is the skater who raised the highest total value. If the numbers of any items sold are changed, the totals and winner should be automatically updated! Simply enter all of the specified data. Do not, however, enter those values that are to be calculated! Once that’s done, we have five basic tasks: a) Formatting the table, including horizontal alignment and merging cells b) Resizing columns to appropriate widths c) Rotating column headers d) Performing basic mathematical calculations e) Utilizing conditional logic to name a winner Tasks a) Apply what you learned from part A, and format the table. The only two differences this time are that you don’t need to write a custom number format, and this time you’ll be using Currency. b) Resizing columns can be done in different ways. The simplest is to hold the cursor at the right-‐edge of a column label (e.g. over the line separating A from B), and dragging the line once the cursor changes to a double-‐arrow. c) Rotating the headings can be done two ways. There’s an Orientation button on the Home tab group, or you can simply right-‐click the cells, choose Format Cells…, pick the Alignment tab, and change orientation in the upper-‐ right panel. APCO 1P01 Fall 2013 – Lab 1 5 You should now have something like this: d) For the math, let’s start small: select cell E3 (corresponding to the total value of Cookies sold by Louise). If you haven’t already, remember to eventually format this cell to display dollars. • Let’s now try calculating part of the real answer: total value raised by Louise from Oatmeal Cookies is: =B3*B11 o It doesn’t matter whether you use lowercase b, or uppercase B. o The asterisk is the multiplication symbol (thus, we’re multiplying 4 by 12). o You don’t need to type that entire formula. You can hit =, click the cell containing the 4, type *, click the cell containing $12, and hit enter. o Make sure you remember to hit enter at the end, or else when clicking on the next cell, it will think you`re still editing the formula. • That`s closer! But we need it to add the results of three multiplications. So, try =B3*B11+C3*C11+D3*D11 and notice that it now correctly tallies up Louise’s Cookies sales. • Above, we explained that the small `handle’ at the lower-‐right corner of a selection was for extending series of values. That also applies to formulae. Try extending that formula down the rest of the column (to E10). • It didn’t work, did it? If you click on one of the generated cells, you’ll see the problem: it correctly guessed that, for Silvia, it needed to make use of how many Oatmeal Cookies Silvia sold. However, the price-‐per-‐Oatmeal Cookie is taken as being in cell B12, rather than B11. This brings us to relative vs absolute cell indices. o An absolute cell index means that you want that specific cell, every time. Even if you extend the formula across several cells, that reference stays the same. We want our references to the numbers of Oatmeal, Chocolate Chip, and Peanut Butter Cookies sold to remain relative, but the references to their per-‐item values to stay constant. To do this, we use the $ symbol. o Try changing Louise`s formula to =B3*$B11+C3*$C11+D3*$D11 and then try extending it down again. It still doesn’t work, right? That’s because the $ symbol applies to row indices and column indices separately. This means that it thinks being in the B column is absolute (which doesn’t affect us either way), but the row index of the prices-‐per-‐item are relative. We want it the other way around. o Try =B3*B$11+C3*C$11+D3*D$11 and extend it down one last time. Note that, if you wanted, you could make the per-‐item value references entirely absolute (i.e. also with fixed column), but that wouldn’t change anything. • Extend the same idea to also calculate money earned on Pizza Sales. o If you did only set the row index as being absolute, you can actually just hit ctrl+c to copy the formula from Cookie Sales, and then ctrl+v to paste it into the Pizza Sales column. Otherwise, apply what you learned in the previous point to write the Pizza Sales version • Next, we need to add up how much each person raised. This is trivial. For example, for J3, the formula is =E3+I3, which can then be extended down. APCO 1P01 Fall 2013 – Lab 1 6 • • Finally, we need the total sums along the bottom edge. For the total amount raised from Cookie Sales, we simply need to use the SUM function, specifying the range of values to add. o Go to cell E12. Type =sum( and move the cursor to cell E3. Press and hold the left mouse button, dragging down until everything up to (and including) E10 is selected. Type ) to close the function, and hit enter. o Click on the cell you just created and you’ll see that you could have simply typed =sum(e3:e10) where E3:E10 is a range of cells to sum. Do the same for the Pizza Sales, and the final total of totals. e) Now we need to declare the winner. For the provided data, there’s only one winner. • Let’s start with a basic IF function. Try the following in cell K3: =IF(1=1,"yep","nope") o The IF function takes three parameters. The first is a condition. In this case, we’re having it ask, “Does 1 equal 1?”. The second term is what it should use if the question answers true. Since 1 does indeed equal 1, it uses yep (again, we’ve put it in “” to show that we want it to use text). If, however, we were to change the first term to 1=2, we’d see that it would give nope, because the third term is what to use if the question answers false. o Try a few more conditional tests. Try 1<2, 1<=2, and 1>2 (note that <= is less than or equal to”, but => is not). Also, try 1<>2 (<> means “not equal to”). o So, we want to decide whether or not to display an asterisk, so first, let’s change what it will display: =IF(1<>2,"*","") (the third term being “” means, “leave it empty”) o Of course, 1<>2 isn’t a helpful test. So, what is? What we want to know is whether the amount Lousie raised is equal to the highest amount raised by anyone. We could try a (bad) approach: =IF(J3=240.50,"*","") would certainly work for this set of data. But, what happens if Cassie realizes she actually sold far more Peanut Butter Cookies than she realized? By selling one more item, $240.50 is no longer the highest amount. o What we want to do is to test equality not against whatever happens to be the current highest value right now, but rather against whatever’s the highest value when we look at it. We can get the highest value with another function, MAX. For example, MAX(J3:J10) will yield the highest total earned by anyone. Thus, we can update our formula as such: =IF(J3=MAX(J$3:J$10),"*","") (Note that $3 and $10 were used because that range needs to stay the same for each skater) o Finally, give it a test: Change Cassie’s Canadian Pizza Sales from 0 to 2, and see that she’s now the winner. (Remember to change those values back before demonstrating to the lab leader, though) You have now completed the work for the lab. Please follow the instructions from the start of the lab exercise and have your lab signed off. Special thanks goes to Earl Foxwell for helping in the creation of this lab. APCO 1P01 Fall 2013 – Lab 1
© Copyright 2026 Paperzz