1*b1cdbd2cSJim Jagielski<?xml version="1.0" encoding="UTF-8"?> 2*b1cdbd2cSJim Jagielski 3*b1cdbd2cSJim Jagielski 4*b1cdbd2cSJim Jagielski<!--*********************************************************** 5*b1cdbd2cSJim Jagielski * 6*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one 7*b1cdbd2cSJim Jagielski * or more contributor license agreements. See the NOTICE file 8*b1cdbd2cSJim Jagielski * distributed with this work for additional information 9*b1cdbd2cSJim Jagielski * regarding copyright ownership. The ASF licenses this file 10*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the 11*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance 12*b1cdbd2cSJim Jagielski * with the License. You may obtain a copy of the License at 13*b1cdbd2cSJim Jagielski * 14*b1cdbd2cSJim Jagielski * http://www.apache.org/licenses/LICENSE-2.0 15*b1cdbd2cSJim Jagielski * 16*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing, 17*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an 18*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 19*b1cdbd2cSJim Jagielski * KIND, either express or implied. See the License for the 20*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations 21*b1cdbd2cSJim Jagielski * under the License. 22*b1cdbd2cSJim Jagielski * 23*b1cdbd2cSJim Jagielski ***********************************************************--> 24*b1cdbd2cSJim Jagielski 25*b1cdbd2cSJim Jagielski 26*b1cdbd2cSJim Jagielski 27*b1cdbd2cSJim Jagielski<helpdocument version="1.0"> 28*b1cdbd2cSJim Jagielski<meta> 29*b1cdbd2cSJim Jagielski<topic id="textscalcguiderelativ_absolut_refxml" indexer="include" status="PUBLISH"> 30*b1cdbd2cSJim Jagielski<title id="tit" xml-lang="en-US">Addresses and References, Absolute and Relative</title> 31*b1cdbd2cSJim Jagielski<filename>/text/scalc/guide/relativ_absolut_ref.xhp</filename> 32*b1cdbd2cSJim Jagielski</topic> 33*b1cdbd2cSJim Jagielski<history> 34*b1cdbd2cSJim Jagielski<created date="2003-10-31T00:00:00">Sun Microsystems, Inc.</created> 35*b1cdbd2cSJim Jagielski<lastedited date="2006-02-14T11:46:48">converted from old format - fpe</lastedited> 36*b1cdbd2cSJim Jagielski</history> 37*b1cdbd2cSJim Jagielski</meta> 38*b1cdbd2cSJim Jagielski<body> 39*b1cdbd2cSJim Jagielski<bookmark xml-lang="en-US" branch="index" id="bm_id3156423"><bookmark_value>addressing; relative and absolute</bookmark_value> 40*b1cdbd2cSJim Jagielski<bookmark_value>references; absolute/relative</bookmark_value> 41*b1cdbd2cSJim Jagielski<bookmark_value>absolute addresses in spreadsheets</bookmark_value> 42*b1cdbd2cSJim Jagielski<bookmark_value>relative addresses</bookmark_value> 43*b1cdbd2cSJim Jagielski<bookmark_value>absolute references in spreadsheets</bookmark_value> 44*b1cdbd2cSJim Jagielski<bookmark_value>relative references</bookmark_value> 45*b1cdbd2cSJim Jagielski<bookmark_value>references; to cells</bookmark_value> 46*b1cdbd2cSJim Jagielski<bookmark_value>cells; references</bookmark_value> 47*b1cdbd2cSJim Jagielski</bookmark> 48*b1cdbd2cSJim Jagielski<paragraph role="heading" id="hd_id3156423" xml-lang="en-US" level="1" l10n="U" oldref="53"><variable id="relativ_absolut_ref"><link href="text/scalc/guide/relativ_absolut_ref.xhp" name="Addresses and References, Absolute and Relative">Addresses and References, Absolute and Relative</link> 49*b1cdbd2cSJim Jagielski</variable></paragraph> 50*b1cdbd2cSJim Jagielski<paragraph role="heading" id="hd_id3163712" xml-lang="en-US" level="2" l10n="U" oldref="3">Relative Addressing</paragraph> 51*b1cdbd2cSJim Jagielski<paragraph role="paragraph" id="par_id3146119" xml-lang="en-US" l10n="U" oldref="4">The cell in column A, row 1 is addressed as A1. You can address a range of adjacent cells by first entering the coordinates of the upper left cell of the area, then a colon followed by the coordinates of the lower right cell. For example, the square formed by the first four cells in the upper left corner is addressed as A1:B2.</paragraph> 52*b1cdbd2cSJim Jagielski<paragraph role="paragraph" id="par_id3154730" xml-lang="en-US" l10n="U" oldref="5">By addressing an area in this way, you are making a relative reference to A1:B2. Relative here means that the reference to this area will be adjusted automatically when you copy the formulas.</paragraph> 53*b1cdbd2cSJim Jagielski<paragraph role="heading" id="hd_id3149377" xml-lang="en-US" level="2" l10n="U" oldref="6">Absolute Addressing</paragraph> 54*b1cdbd2cSJim Jagielski<paragraph role="paragraph" id="par_id3154943" xml-lang="en-US" l10n="U" oldref="7">Absolute references are the opposite of relative addressing. A dollar sign is placed before each letter and number in an absolute reference, for example, $A$1:$B$2.</paragraph> 55*b1cdbd2cSJim Jagielski<paragraph role="tip" id="par_id3147338" xml-lang="en-US" l10n="U" oldref="36">$[officename] can convert the current reference, in which the cursor is positioned in the input line, from relative to absolute and vice versa by pressing Shift +F4. If you start with a relative address such as A1, the first time you press this key combination, both row and column are set to absolute references ($A$1). The second time, only the row (A$1), and the third time, only the column ($A1). If you press the key combination once more, both column and row references are switched back to relative (A1)</paragraph> 56*b1cdbd2cSJim Jagielski<paragraph role="paragraph" id="par_id3153963" xml-lang="en-US" l10n="U" oldref="52">$[officename] Calc shows the references to a formula. If, for example you click the formula =SUM(A1:C5;D15:D24) in a cell, the two referenced areas in the sheet will be highlighted in color. For example, the formula component "A1:C5" may be in blue and the cell range in question bordered in the same shade of blue. The next formula component "D15:D24" can be marked in red in the same way.</paragraph> 57*b1cdbd2cSJim Jagielski<paragraph role="heading" id="hd_id3154704" xml-lang="en-US" level="2" l10n="U" oldref="29">When to Use Relative and Absolute References</paragraph> 58*b1cdbd2cSJim Jagielski<paragraph role="paragraph" id="par_id3147346" xml-lang="en-US" l10n="U" oldref="8">What distinguishes a relative reference? Assume you want to calculate in cell E1 the sum of the cells in range A1:B2. The formula to enter into E1 would be: =SUM(A1:B2). If you later decide to insert a new column in front of column A, the elements you want to add would then be in B1:C2 and the formula would be in F1, not in E1. After inserting the new column, you would therefore have to check and correct all formulas in the sheet, and possibly in other sheets.</paragraph> 59*b1cdbd2cSJim Jagielski<paragraph role="paragraph" id="par_id3155335" xml-lang="en-US" l10n="U" oldref="9">Fortunately, $[officename] does this work for you. After having inserted a new column A, the formula =SUM(A1:B2) will be automatically updated to =SUM(B1:C2). Row numbers will also be automatically adjusted when a new row 1 is inserted. Absolute and relative references are always adjusted in $[officename] Calc whenever the referenced area is moved. But be careful if you are copying a formula since in that case only the relative references will be adjusted, not the absolute references.</paragraph> 60*b1cdbd2cSJim Jagielski<paragraph role="paragraph" id="par_id3145791" xml-lang="en-US" l10n="U" oldref="39">Absolute references are used when a calculation refers to one specific cell in your sheet. If a formula that refers to exactly this cell is copied relatively to a cell below the original cell, the reference will also be moved down if you did not define the cell coordinates as absolute.</paragraph> 61*b1cdbd2cSJim Jagielski<paragraph role="paragraph" id="par_id3147005" xml-lang="en-US" l10n="U" oldref="10">Aside from when new rows and columns are inserted, references can also change when an existing formula referring to particular cells is copied to another area of the sheet. Assume you entered the formula =SUM(A1:A9) in row 10. If you want to calculate the sum for the adjacent column to the right, simply copy this formula to the cell to the right. The copy of the formula in column B will be automatically adjusted to =SUM(B1:B9).</paragraph> 62*b1cdbd2cSJim Jagielski<section id="relatedtopics"> 63*b1cdbd2cSJim Jagielski<embed href="text/scalc/guide/value_with_name.xhp#value_with_name"/><comment>mw changed link target from "address_byname" to "value_with_name"</comment><embed href="text/scalc/guide/address_auto.xhp#address_auto"/> 64*b1cdbd2cSJim Jagielski</section> 65*b1cdbd2cSJim Jagielski</body> 66*b1cdbd2cSJim Jagielski</helpdocument> 67