Está en la página 1de 11

# Why use dollar sign (\$) in Excel formulas - absolute and

relative cell references

When writing an Excel formula, \$ in cell references confuses many users. But the explanation is very simple.
The dollar sign in an Excel cell reference serves just one purpose - it tells Excel whether to change or not to
change the reference when the formula is copied to other cells. And this short tutorial provides full details about
this great feature.

The importance of Excel cell reference can hardly be overstated. Get the insight into the difference between
absolute, relative and mixed references, and you are halfway to mastering the power and versatility of Excel
formulas and functions.

All of you have probably seen the dollar sign (\$) in Excel formulas and wondered what's that all about. Indeed,
you can reference one and the same cell in four different ways, for example A1, \$A\$1, \$A1, and A\$1.

The dollar sign in an Excel cell reference affects just one thing - it instructs Excel how to treat the reference when
the formula is moved or copied to other cells. In a nutshell, using the \$ sign before the row and column
coordinates makes an absolute cell reference that won't change. Without the \$ sign, the reference is relative and
it will change.

If you are writing a formula for a single cell, you can go with any reference type and get the formula right anyway.
But if you intend to copy your formula to other cells, choosing the appropriate cell reference type is crucial. If
you feel lucky, you can toss a coin :) If you want to be serious, then invest a few minutes in learning the ins-and-
outs of absolute and relative cell references in Excel, and when to use which one.

What is an Excel cell reference?
To put it simply, a cell reference in Excel is a cell address. It tells Microsoft Excel where to look for the value you
want to use in the formula.

For example, if you enter a simple formula =A1 in cell C1, Excel will pull a value from cell A1 into C1:

As already mentioned, as long as you write a formula for a single cell,
you are free to use any reference type, with or without the dollar sign (\$),
the result will be the same:

But if you want to move or copy the formula across the worksheet, it's very important that you choose the right
reference type for the formula to get copied correctly to other cells. The following sections provide the detailed
explanation and formula examples for each cell reference type.

Note. Apart from the A1 reference style, where columns are defined by letters and rows by numbers, there also
exist the R1C1 reference style where both rows and columns are identified by numbers (R1C1 designates row
1, column 1).

Because A1 is the default reference style in Excel and it is used most of the time, we will discuss only the A1 type
references in this tutorial. If someone is currently using the R1C1 style, you can turn it off by clicking File >
1/11

2/11 . let's discuss a real-life example.93. The following example shows how relative references work.EUR conversion rate (0. When a formula with relative cell references in copied to another cell. is as simple as =B2*0. both column and row references will change: As you see. Notice. like A1. without the dollar sign.93 at the moment of writing). all references in Excel are relative. Knowing the USD . By default. that we are using an Excel relative cell reference. To better illustrate this. Excel relative cell reference (without \$ sign) A relative reference in Excel is a cell address without the \$ sign in the row and column coordinates. and you want to convert them to EUR. Using relative reference is Excel .Options > Formulas. and then unchecking the R1C1 reference style box. the reference changes based on a relative position of rows and columns. the formula will adjust for row 2 (A2*10) because Excel assumes you want to multiply a value in each row of column A by 10. Excel will change the column reference accordingly: And if you copy or move an Excel formula with a relative cell reference to another row and another column. say to cell B2.formula example Supposing you have a column of USD prices (column B) in your worksheet. If you copy the formula with a relative cell reference to another column in the same row. using relative cell references in Excel formulas is a very convenient way to perform the same calculations across the entire worksheet. the formula for row 2. Supposing you have the following formula in cell B1: =A1*10 If you copy this formula to another row in the same column.

That's it! The formula is copied to other cells with relative references that are adjusted properly for each individual cell. On the other hand. the cursor will change to a thin black cross. In other words. To make sure that a value in each cell is calculated correctly. To copy the formula down the column . if you write the same formula with a relative cell reference (A1). using \$ in cell references allows you to copy the formula in Excel without changing references. when writing a formula. exactly as it should be: Excel absolute cell reference (with \$ sign) An absolute reference in Excel is a cell address with the dollar sign (\$) in the row or column coordinates. if you have 10 in cell A1 and you use an absolute cell reference (\$A\$1). and then copy it down to other cells in the column. you can add a relative reference by clicking the corresponding cell on the worksheet instead of typing a cell reference manually. By default. no matter what other cells that formula is copied to. a different value will be calculated for each row. like \$A\$1. For example. The following image demonstrates the difference: 3/11 . so that it remains unchanged no matter where the formula moves. hover the mouse over the fill handle (a small square in the bottom-right corner of the selected cell). and see that the cell reference in the formula is relative to row 4. As you do this. I've selected cell C4. and the result will immediately appear in the cell. all cell references in Excel are relative references. the formula =\$A\$1+5 will always return 15.Pressing the Enter key will get the formula calculated. Tip. So. and you hold and drag it over the cells you want to auto-fill. select any of the cells and view the formula in the formula bar. In this example. The dollar sign fixes the reference to a given cell.

Instead. In other words. Though we have been saying that an absolute reference in Excel never changes. Excel is smart enough to adjust the formula to reflect that change: In real worksheets. as demonstrated in the following examples. Relative and absolute cell references for calculating numbers In our previous example with USD and EUR prices. and fix that cell reference in the formula by using the dollar sign (\$) like shown in the following screenshot: 4/11 . However. and this changes the location of the referenced cell. while others remain fixed on specific cells. say C1. if we insert a new row at the top of the worksheet. Example 1.Note. you may not want to hardcode the exchange rate in the formula. you can enter that number in some cell. it's a very rare case when you'd use only absolute references in your Excel formula. In the above example. there are a lot of tasks that require using both absolute and relative references. you have to use relative and absolute cell references in a single formula. in fact it does change when you add or remove rows and/or columns in your worksheet. Using relative and absolute cell references in one formula Quite often you may need a formula where some cell references are adjusted for the columns and rows where the formula is copied.

like \$A1. Once the conversion rate changes. In this reference type. only one coordinate is fixed (absolute) and the other (relative) will change based on a relative position of the row or column: Absolute column and relative row. For example. When a formula with this reference type is copied to other cells. because you want this cell reference to remain constant. What you want to know is in how many days each item ships. it's the row's reference that won't change. like A\$1. and you can calculate this out by using the following formula: =B4-\$C\$1 And again. all you have to do is to update the value in cell C1. Wrapping up. we use two reference types in the formula: Relative for the cell with the first delivery date (B4). there are two cell reference types: B4 . because you want this cell reference to vary depending on the row where the formula resides. Supposing you have a list of delivery dates in column B. In a mixed cell reference.In this formula (B4*\$C\$1). Excel mixed cell reference A mixed cell reference in Excel is a reference where either the column letter or a row number is fixed. Relative column and absolute row . the \$ sign in front of the column letter locks the reference to the specified column so that it never changes. Example 2. \$A1 and A\$1 are mixed references. and you input the current date in C1 by using the TODAY() function. Absolute for the cell with today's date (\$C\$1). An advantage of this approach is that your users can calculate EUR prices based on a variable exchange rate without changing the formula. without the dollar sign.relative cell reference that is adjusted for each row. As you remember. be sure to include the dollar sign (\$) in your formula to create an absolute reference in Excel. and the column's reference will. 5/11 . Relative and absolute cell references for calculating dates Another common use of absolute and relative cell references in a single formula is Calculating dates in Excel based on today's date. The relative row reference. whenever you want to create an Excel static cell reference that always refers to the same cell.absolute cell reference that never changes no matter where the formula is copied. But what does each mean? It's very simple. and \$C\$1 . an Excel absolute reference contains 2 dollar signs (\$) that lock both the column and the row. varies depending on the row to which the formula is copied.

say row 2. Using a mixed reference in Excel - formula example For this example. we won't limit ourselves only to the USD . let's enter the conversion rates in some row. let's select cell D7 (in the GBP column). And now. For example. you write just one formula for the top-left cell (C5 in this example) to calculate the EUR price: =\$B5*C\$2 Where \$B5 is the dollar price in the same row. and C\$2 is the USD .EUR conversion. just what the doctor ordered :) 6/11 . you will have 3 different price columns calculated correctly based on the corresponding exchange rate in row 2 in the same column. select any cell in the table and view the formula in the formula bar. What we are going to do is to convert the dollar prices to a number of other currencies. As the result.Below you will find an example of using both mixed cell reference types that will hopefully make things easier to understand. which is the USD-GBP conversion rate. To verify this. And then. as shown in the screenshot below. we will be using our currency conversion table again. all with a single formula! To begin with. and after that auto-fill other columns with the same formula by dragging the fill handle. What we see here is the formula =\$B7*D\$2 that takes a USD price in B7 and multiplies it by the value in D2. But this time.EUR conversion rate. copy the formula down to other cells in column C.

C\$2 .absolute column and relative row . \$B5 . just type a column letter twice and a colon in between. you lock the row reference by putting the dollar sign (\$) in front of the row number. The row reference (without the \$ sign) is not locked because you want to calculate the prices for each row individually. Here you add the dollar sign (\$) only before the column letter to anchor the reference to column A. Because all the exchange rates reside in row 2. you use the dollar sign (\$) in an absolute column reference to lock it to a certain column. A whole-row reference To refer to the entire row. an entire column reference can be absolute and relative.And now.relative column and absolute row . you may want to refer to all of the cells within a specific column. And now. like A:A And again. like \$A:\$A Relative column reference. As you may have guessed. And because the column reference is relative (without \$ sign). like \$1:\$1 7/11 . for example: Absolute column reference. so Excel always uses the original USD prices for all conversions. it will get adjusted for the column to which the formula is copied. To reference the whole column. no matter what row you copy the formula to. How to reference an entire column or row in Excel When you are working with an Excel worksheet that has a variable number of rows. it's the mixed cell references that do the trick (\$B5*C\$2). you use the same approach except that you type row numbers instead of column letters: Absolute row reference. A whole-column reference As well as cell references. A relative column reference will change when the formula is copied or moved to other columns and will remain intact when you copy the formula to other cells within the same column. for example A:A. let's understand how it comes that Excel exactly knows which price to take and which exchange rate to multiply it by. for the entire-column reference not to change when you copy a formula to other cells. Excel will always look for the exchange rate in row 2.

The problem is that new rows are added to the table every week. you can also create a mixed entire-column reference or mixed entire-row reference. so writing a usual SUM() or AVERAGE() formula for a fixed range of cells is not the way to go. Relative row reference. because I cannot think of any practical application of such references. you can reference the entire column B: =SUM(\$B:\$B) . =SUM(B:B) . though Example 4 proves that formulas with such references work exactly as they are supposed to. never input the formula anywhere within the same column. For example. As is the case with cell references.write the formula with no \$ to make a relative whole-column reference that will get changed as you copy the formula to other columns. like \$A:A or \$1:1. Example 1.use the dollar sign (\$) to make an absolute whole-column reference that locks the formula to column B. we are using a relative entire-column reference. we write a formula to calculate the average price in the whole column B: =AVERAGE(B:B) In this example. When writing the formula. so our formula gets adjusted properly when we copy it to other columns: Note. respectively. When using an entire-column reference in your Excel formulas. it might seem like a good idea to enter the formula =SUM(B:B) in one of the 8/11 . Excel entire-column reference (absolute and relative) Supposing you have some numbers in column B and you want to find out their total and average. like 1:1 In theory. I say "in theory". click the column letter to have the entire-column reference added to the formula. Instead. Excel inserts a relative reference (with no \$ sign) by default: In the same fashion. Tip.

2010. Earlier Excel versions have a row maximum of 65. Example 2. we need a relative entire-row reference because we have 3 rows of data and we want to calculate an average in each row by copying the same formula: Example 3. then you can reference an entire row in your formula. So. a maximum is 1. In Excel 2016. Don't do this! This would create a so-called circular reference and the formula would return 0. you enter the following formula in cell F2. Regrettably.a relative whole-row reference will change when the formula is copied to other rows. your formula will most likely return the #NAME error.empty bottom-most cells in column B to have the total at the end of the same column. Instead. you can specify a maximum row. and then copy it to cells G2 and H2: =AVERAGE(B5:B1048576) 9/11 . How to refer to an entire column excluding the first few rows This is a very topical problem. to find an average for each price column in the below table (columns B through D). =AVERAGE(2:2) . If you try adding such a reference.384 columns. In this example.576 rows and 16. and 2007. Excel entire-row reference (absolute and relative) If the data in your Excel sheet is organized in rows rather than columns. For example. because quite often the first few row in a worksheet contain some introductory clause or explanatory information and you don't want to include them in your calculations. so that your reference includes all possible rows in a given column. 2013. Excel does not allow references like B5:B that would include all the rows in column B beginning with row 5.an absolute whole-row reference is locked to a specific row by using the dollar sign (\$). this is how we can calculate an average price in row 2: =AVERAGE(\$2:\$2) .048.536 and column maximum of 256.

you can hit the F4 key to speed things up. you can also subtract the rows you want to exclude: =SUM(B:B)-SUM(B1:B4) Example 4. the formula will add up all the numbers in columns B and C. Not sure if this has any practical value. Supposing you input the formula =SUM(\$B:B) in some cell. F2 in this example. Or.If you are using the SUM function. let's see what happens when you copy a formula with such references to other cells. \$ sign can of course be typed manually to change a relative cell reference to absolute or mixed. and mixed references (F4 key) When you write an Excel formula. like \$1:1 Now. while the second isn't. it changes to =SUM(\$B:C) because the first B is fixed with the \$ sign. you can also make a mixed entire-column or entire-row reference in Excel: Mixed column reference. relative. you have to be in formula edit mode: 10/11 . Using a mixed entire-column reference in Excel As I mentioned a few paragraphs before. but you may want to know how it works: A word of caution! Don't use too many entire column/row references in a worksheet because they may slow down your Excel. like \$A:A Mixed row reference. For the F4 shortcut to work. As the result. How to switch between absolute. When you copy the formula to the adjacent right-hand cell (G2).

In the meantime. and select the cell reference you want to change. Press F4 to toggle between four cell reference types. I thank you for reading and hope to see you on our blog next week! You may also be interested in 11/11 . I hope now you fully understand what relative and absolute cell references are. circular reference. If you press F4 without selecting any cell reference. or just click inside the formula bar. the reference to the left of the mouse pointer will get selected automatically and changed to another reference type. In the next few articles. absolute column \$A1. and then back to the relative reference A1. repeatedly hitting the F4 button toggles between an absolute reference with both dollar signs like \$A\$1. we will continue learning various aspects of Excel cell references such as referencing another worksheet. 3. and so on. absolute row A\$1. If you've selected a relative cell reference with no \$ sign. like A1. 2. Select the cell with the formula. structured reference. 3d reference. and an Excel formula with \$ signs is no longer a mystery. 1. Enter Edit mode by pressing the F2 key. Note.