Information Technology Topic
Relative and Absolute Addressing
- Read notes
- Flashcards
- Quiz
- Confident
Study focus - 3 things
- A relative reference such as B2 shifts by the same number of rows and columns as the copy, and it is the default kind of reference
- An absolute reference such as $E$2 is locked with dollar signs and always points at the same cell, which is what a single rate used by a whole column needs
- To predict a copied formula, count the rows and columns moved, shift only the unlocked parts and leave the dollar-sign parts exactly as they are
Visual notes
Without the lock the rate reference slides down to empty cells and shows 0; with $E$2 the hat, bag and mug come out at 1,860, 3,100 and 1,240 (J$).
Section 1Why one formula can fill a whole column
Picture a craft stall in Negril with forty items priced in US dollars. Nobody wants to type forty different formulas. You type one formula, copy it down the column (copy and paste, or drag it down) and the spreadsheet makes a version for every row. Here's the trick: a formula points at other cells using their cell references, such as B2. When you copy the formula, the program has to decide where each reference should point in the new place. Relative and absolute addressing are the two rules it can follow. So for every reference in a formula you ask one question: should it move with the copy, or stay put?
Section 2Relative addressing: the default
A relative reference describes where a cell is compared with the cell holding the formula. In D2, =B2*C2 really says 'multiply the cell two to my left by the cell one to my left'. Copy it to D3 and the same description now picks out B3 and C3, so the formula becomes =B3*C3. This is the default. Type B2 with no dollar signs and it is relative. The idea works sideways too: =B2+C2 in D2, copied one column to the right, becomes =C2+D2, because every column letter steps one place along. The thing to remember: copying down changes the row numbers, and copying across changes the column letters.
Section 3Absolute addressing: lock it with dollar signs
An absolute reference always points at the same cell, wherever the formula is copied. You make one by typing a dollar sign before the column letter and before the row number, so $E$2 is the absolute form of E2. Copy =B2*$E$2 down to row 4 and you get =B4*$E$2: the B moves to the new row, but $E$2 does not move at all. Most programs have a shortcut key that adds the dollar signs for you, so you do not have to type them by hand. Typing them yourself works just as well.
Section 4Which one do I use?
For each reference ask: does every copy need its own cell, or does every copy need the same cell? A price, quantity or score that belongs to one row should be relative. A single value that every row uses, such as an exchange rate, a discount percentage or a grand total, should be absolute. A good habit is to put the rate in a cell of its own with a label beside it, instead of typing the number into every formula. Then when the rate changes you change one cell and every formula follows. A rate typed in as =B2*155 hides the number, and you must edit every formula to change it. Watch out: absolute does not mean the cell can never change. You can still type a new rate into E2. The lock only stops the reference moving when the formula is copied.
Section 5Worked pattern: US dollars to Jamaican dollars
Look at the figure. The Negril stall prices items in US dollars, and one cell, E2, holds the rate of J$155 for US$1 (an invented rate for practice). Column C copies =B2*E2 down. Row 2 is right at J$1,860, but in row 3 the formula has slid to =B3*E3, and E3 is empty, so it shows 0. Row 4 shows 0 too. Column D uses =B2*$E$2 and copies correctly: J$1,860 for the hat, J$3,100 for the bag and J$1,240 for the mug. The giveaway of a missing lock is a first row that is right and rows below it that are wrong, often zeros. Click the formula in the last row and read it in the formula bar: if the rate reference has moved, you have found the culprit.
Section 6Predicting a copied formula
You can work out any copied formula in three steps. First, count how far the copy moved: how many rows down and how many columns across. Second, for every reference with no dollar signs, add the rows moved to its row number and the columns moved to its column letter. Third, leave any locked part exactly as it is. Example: =$B$1*C2 typed in D2 and copied to F4 has moved 2 columns right and 2 rows down. C2 becomes E4 and $B$1 stays, giving =$B$1*E4. Ranges follow the same rules: =SUM(B2:B5) typed in B6 and copied to D6 becomes =SUM(D2:D5). Watch out: this topic is about copying. What happens when you move or delete cells is a different topic.
Examples
A craft stall in Negril lists a hat at US$12, a bag at US$20 and a mug at US$8 in cells B2, B3 and B4. Cell E2 holds the exchange rate of J$155 for US$1. In C2 you type a formula to find the hat's price in J$, then copy it down to C4. (a) Write a formula for C2 that copies correctly. (b) Write the formulas that appear in C3 and C4 and the three results. (c) What would C3 and C4 show if you had typed =B2*E2 instead, and why?
(a) The price belongs to each row, so B2 stays relative. The rate is one cell used by every row, so it must be locked: C2 is =B2*$E$2. (b) Copying down one row gives C3 =B3*$E$2 and two rows gives C4 =B4*$E$2. Only the B part moves. The results are 12 x 155 = J$1,860, 20 x 155 = J$3,100 and 8 x 155 = J$1,240. (c) With =B2*E2 both references are relative, so the rate reference slides: C3 becomes =B3*E3 and C4 becomes =B4*E4. E3 and E4 are empty, so both show 0. Row 2 looked right, which is why this slip is easy to miss.
A uniform shop in Portmore lists a school bag at J$4,000, shoes at J$6,500 and a uniform at J$3,200 in B2, B3 and B4. Cell F2 holds a discount rate of 10% (the value 0.1). In C2 you type =B2*$F$2 to find the discount, and in D2 you type =B2-C2 for the sale price. Then you copy C2 and D2 down to row 4. (a) Write the formulas in C4 and D4. (b) Give the discount and sale price for each item. (c) Suppose D2 is instead copied one column to the right into E2. What formula appears there and what does it show?
(a) Copying down two rows: C4 becomes =B4*$F$2 (B moves, $F$2 stays) and D4 becomes =B4-C4 (both are relative, so both move down). (b) Bag: 4,000 x 0.1 = 400, so the sale price is 4,000 - 400 = 3,600. Shoes: 6,500 x 0.1 = 650, so 6,500 - 650 = 5,850. Uniform: 3,200 x 0.1 = 320, so 3,200 - 320 = 2,880. (c) Copying across one column shifts every column letter by one: =B2-C2 becomes =C2-D2. That subtracts the sale price (3,600) from the discount (400) and shows -3,200, which is meaningless here. Copy direction matters, and the same formula can be right when copied down and wrong when copied across.
Now let's water it
Session runs notes to flashcards to quiz back-to-back.
Where this comes from
- CSEC Information Technology Syllabus (CXC 30/G/SYLL 08, revised 2000, 2008, 2013) · Caribbean Examinations Council (CXC) · Section 7, Specific Objective 5 · Syllabus scope
- CSEC Information Technology Syllabus (CXC 30/G/SYLL 08, revised 2000, 2008, 2013) · Caribbean Examinations Council (CXC) · Section 7, Specific Objective 7 · Syllabus scope
- Calc Guide 7.6 (LibreOffice 7.6 Community) · The Document Foundation (LibreOffice Documentation Team) · Chapter 8, Relative and absolute references, pp 278-280, checked against (https://documentation.libreoffice.org/assets/Uploads/Documentation/en/CG7.6/CG76-CalcGuide.pdf) · Facts
- Calc Guide 7.6 (LibreOffice 7.6 Community) · The Document Foundation (LibreOffice Documentation Team) · Chapter 8, Creating formulas, pp 271-274, checked against (https://documentation.libreoffice.org/assets/Uploads/Documentation/en/CG7.6/CG76-CalcGuide.pdf) · Facts