Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Relative References within Named Ranges.

Relative References within Named Ranges

Written by Allen Wyatt (last updated August 20, 2022)
This tip applies to Excel 97, 2000, 2002, and 2003


Chris has set up a worksheet where he uses named ranges (rows) in his formulas. He has named the entire sales row as "Sales," and then uses the Sales name in various formulas. For instance, in any given column he can say =Sales, and the value of the Sales row, for that column, is returned by the formula. Chris was wondering how to use the same formula technique to refer to cells in different columns.

There are a couple of different ways this can be done. First of all, you can use the INDEX function to refer to the cells. The rigorous way to refer to the value of Sales in the same column is as follows:

=INDEX(Sales,1,COLUMN())

This works if the Sales named range really does refer to the entire row in the worksheet. If it does not (for instance, Sales may refer to cells C10:K10), then the following formula refers to the value of Sales in the same column in which the formula occurs:

=INDEX(Sales,1,COLUMN()-COLUMN(Sales)+1)

If you want to refer to a different column, then simply adjust the value that is added to the column designation in the INDEX function. For example, if you wanted to determine the difference between the sales for the current column and the sales in the previous column, then you would use the following:

=INDEX(Sales,1,COLUMN()-COLUMN(Sales)+1) - INDEX(Sales,1,COLUMN()-COLUMN(Sales))

The "shorthand" version for this formula would be as follows:

=Sales - INDEX(Sales,1,COLUMN()-COLUMN(Sales))

There are other functions you can use besides INDEX (such as OFFSET), but the technique is still the same—you must find a way to refer to an offset from the present column.

There is an easier way to get at the desired data, however. Let's say that your Sales range also has a heading row about it, similar to what is shown in the following: (See Figure 1.)

Figure 1. Example sales data.

The heading row lists the years for the range, and the values under the headings are those that actually make up the Sales range. To make sure this technique will work, follow these steps:

  1. Choose Options from the Tools menu. Excel displays the Options dialog box.
  2. Make sure the Calculation tab is displayed. (See Figure 2.)
  3. Figure 2. The Calculation tab of the Options dialog box.

  4. Ensure that the Accept Labels in Formulas check box is selected.
  5. Click OK.

With this configuration change done, you can use the following as your formulas:

=Sales '2009' – Sales '2004'

What you are actually doing is instructing Excel to work with unions of cells. In this instance, Sales '2009' returns the cell at the intersection of the Sales range and the '2009' column. A similar union is returned for the portion of the formula to the right of the minus sign. The result is the subtraction of the two values you wanted.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (3202) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Relative References within Named Ranges.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Putting Your Index after Your Endnotes

Endnotes are supposed to be at the end of your document, right? Not necessarily. You may want something else at the end, ...

Discover More

Creating Venn Diagrams with Excel Data

A common way of representing data is to use a Venn diagram. Unfortunately, Excel doesn't have a precise way of creating ...

Discover More

Entering a Page Break from the Keyboard

Need to force Word to move text to the top of the next page? It's easy when you use the keyboard shortcut for a page break.

Discover More

Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!

More ExcelTips (menu)

Retrieving the Last Value in a Column

Need to get at the last value in a column, regardless of how many cells are used within that column? You can apply the ...

Discover More

Averaging Values for a Given Month and Year

Excel is often used to analyze data collected over time. In doing the analysis, you may want to only look at data ...

Discover More

Counting Only Money Winners

If a series of cells contain the amount of money won by individuals, you may want to count the number of individuals who ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is four minus 0?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.