Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Static cell reference google spreadsheet

I have a two sheets "One" and "Two"

I want column A in "One" to reference column B in "Two" the following works fine up to a point.

A1 = Two!B1

Then I use the fill to populate the rest of the column. The problem is in Two I continually want to add a column to the left of B which becomes the new B. I want A1 to reference the new B1, but spreadsheets automagically updates all reference in One to C instead of B. Is there a way to force B to remain static?

like image 657
MrBrightside Avatar asked Jun 10 '13 15:06

MrBrightside


People also ask

How do you make a cell reference static in Google Sheets?

To override this default behavior, Use a $ sign to keep the reference "static" when pasting the formula into other cells. For example, if you are in cell A1 and the formula in that cell references B1 , then if you copy-paste this formula into cell A2 , the formula actually pasted in the cell references B2 .

How do you keep a cell reference constant in Google Sheets?

Say you want to keep cell A2 constant. To do that, click on the cell reference in the formula bar (A2), and enter $ before column and row ($A$2). You can also press F4 on the keyboard to make variable cell constant.

How do I lock a reference in a formula in Google Sheets?

The shortcut for locking your cell reference is to use F4 on your keyboard. After you select your cell for your formula, press F4 to place two dollar signs in your cell reference for an absolute cell reference. Press F4 twice for locking row reference, and press F4 three times for locking column reference.

How do you freeze a cell reference?

If you want to maintain the original cell reference when you copy it, you "lock" it by putting a dollar sign ($) before the cell and column references. For example, when you copy the formula =$A$2+$B$2 from C2 to D2, the formula stays exactly the same. This is an absolute reference.


2 Answers

Yes.

Use $A$1 to make the reference remain static.

Read more here: http://www.gcflearnfree.org/googlespreadsheets/14.3

like image 95
Jonatan Littke Avatar answered Oct 01 '22 18:10

Jonatan Littke


TLDR;
A1 is a reference relative to the current cell. Copy-paste will update this reference.
$A$1 is a static reference to a specific cell. Copy-paste will not change this reference.
Relative and Absolute References in Google Sheets and Excel.

Spreadsheets do the heavy lifting for you, by defaulting cell references in formulas as a "relative" to the current cell.
To override this default behavior, Use a $ sign to keep the reference "static" when pasting the formula into other cells.

For example, if you are in cell A1 and the formula in that cell references B1, then if you copy-paste this formula into cell A2, the formula actually pasted in the cell references B2. This is generally what we want.

However, if you are in cell A1 and the formula in that cell now says $B$1 (it will still reference the cell B1, as before), but
then if you copy-paste this formula into cell A2, the formula actually pasted in the cell will still say ($B$1) (and still reference the cell B1).

You can also use "mixed" references, where only the column or row is static, and the other is a dynamic reference. For example $B1 or B$1. This link gives a good example and use case (creating multiplication tables) for mixed references, as well as static vs relative references, and warns to always use static references with vlookup and arrays: Relative and Absolute References in Google Sheets and Excel.

like image 36
SherylHohman Avatar answered Oct 01 '22 20:10

SherylHohman