Excel Dragging Handout

advertisement
INTRODUCTION TO LINEAR PROGRAMMING
EXCEL FILL HANDLE EXPLANATION
The Fill Handle in Excel is possibly one of Excel’s most under utilized features. For those of
you that don't know of it, it's the small black square in the bottom right of the active cell.
In its simplest form it will increment any series of numbers. For example, if you type the
number 1 in any cell and then the number 2 in a cell that adjoins it, you can use the Fill Handle
to increment up to any number desired. To do this you simply select your two cells (starting
from the one with the number 1) and then hover your mouse pointer over the Fill Handle (until it
changes to a small black cross), left click and drag in the direction you want the incremented
numbers to show.
You can also do the same by entering any starting number in any cell, selecting the cell, holding
down the Ctrl key and then dragging down with the Fill Handle. If you do not hold down the Ctrl
key, Excel will simply copy the same number.
For the purposes of the MINDSET materials, we will be using the Fill Handle for formulas. For
example, if you type the formula =A1+A2+A3 from the above example into cell C3, this will
yield 1 + 2 + 3 = 6.
Then, click on cell C1. Left click on the Fill Handle and drag until you reach cell C13. This will
fill in our formula for all cells.
©2010 North Carolina State University: MINDSET
1
To see the formulas written out for each of the cells, hold down the Ctrl key and hit ~; complete
the same process to undo this.
Notice how the formulas change as we move down the column. Sometimes, we only want a
portion of the formula to change as we drag
To do this, we use the dollar sign as an absolute cell reference, for example $A$1. That is, the
cell $A$1 is an absolute reference to the data, formula, or string in cell A1 of a worksheet. This
means that it will still refer to cell A1 if you drag out a formula that refers to it, or otherwise
copy a formula to another cell. The default in Excel is relative reference, so if you drag a
formula referring to cell A1 to, say cell E20 from cell E19, it would then refer to cell A2.
To make a cell reference absolute, you can either type in the $ sign by hand or you could press
F4 while the cursor is on the cell reference.
Back on our worksheet, in cell C1, change A1 to $A$1. Click on the Fill Handle and drag down
to C13. Notice how, in each formula, the absolute reference cell ($A$1) does not change but the
other cells do.
Excel Dragging Handout (Part II)
©2010 North Carolina State University: MINDSET
2
Now, consider the Computer Flips problem (Section 1.1). Each constraint formula must take the
coefficients and multiply them by the respective variable. For the example below, the left hand
side of the installation time constraint function is
60 x1  120 x2  90 x3  150 x4
To type this into Excel, we would have
=B12*$B$7 + C12*$C$7 + D12*$D$7 + E12*$E$7
Similarly, the left hand side of the testing time constraint function in Excel is
=B13*$B$7 + C13*$C$7 + D13*$D$7 + E13*$E$7
Notice that both constraint functions are of the form:
=___*$B$7 + ___*$C$7 + ___*$D$7 + ___*$E$7
Because each function needs to multiply the coefficients by the respective variables in row 7, we
can use absolute cell references. Therefore, we only need to type the first constraint function
(installation time) while making sure to include $’s for cells B7, C7, D7, and E7. Then we can
use the Fill Holder to complete the remaining constraints.
©2010 North Carolina State University: MINDSET
3
Note: in the MINDSET materials, rather than $A$1, we wrote A$1. For our purposes, these two
ways of writing the absolute reference cell are the same. However, by having the extra $ before
the column reference will allow you to drag a formula along a row while keeping your absolute
reference cell. In other words, the first $ freezes the column reference and the second $ freezes
the row. In the MINDSET materials, we will only be dragging down columns so we will only
need to freeze the row and the column reference will be unnecessary.
References
Fill Handle: How to Use Excel's Fill Handle on Data in Your Excel Spreadsheet, from
http://www.ozgrid.com/Excel/excel-fill-handle.htm
Similar questions with dollar sign Microsoft Excel, from
http://askville.amazon.com/SimilarQuestions.do?req=dollar-sign-Microsoft-Excel
©2010 North Carolina State University: MINDSET
4
Download