Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, and 2016. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Relative Worksheet References.

Relative Worksheet References

Written by Allen Wyatt (last updated August 17, 2021)
This tip applies to Excel 2007, 2010, 2013, and 2016


Suppose you have a workbook with three worksheets, Sheet1, Sheet2 and Sheet3. In column A1 of worksheet Sheet2 you have the formula =Sheet1!A1. When you copy that formula from Sheet2 to cell A1 of Sheet3, the formula still references Sheet1. How can that be, though? Why doesn't Excel adjust the sheet reference, like it does the cell references?

Like named ranges, Excel treats worksheet names as absolute. Each worksheet object is independent of all other worksheets in the workbook. When you paste a formula that includes a sheet reference, that sheet reference is left unchanged in what is pasted.

There are a couple of things you can do. One is to simply modify the formula reference after it is pasted so that it references the correct sheet. If you have many of them to change, then you can select all the formulas in the target worksheet (F5 | Special | Formulas) and then use Find and Replace to replace the original worksheet name (Sheet1) with the correct worksheet name (Sheet2).

If your referencing needs are not complex, then you can use a macro approach. For instance, if you want a formula in a particular cell to refer to a cell on the sheet previous to the current sheet, then you can do that by macro rather easily. Consider the following macro:

Function PrevSheet(rCell As Range)
    Dim i As Integer
    i = rCell.Cells(1).Parent.Index
    PrevSheet = Sheets(i - 1).Range(rCell.Address)
End Function

The macro looks at the current worksheet and then figures out which worksheet is before it. The reference is then made for that worksheet. Once you've created the PrevSheet macro, here's one way the function can be used in a cell:


This returns the value of cell A1 from the previous worksheet. If you have Sheet1, Sheet2, and Sheet3, and you use this formula on Sheet3, then it returns the value of Sheet2!A1. If the previous sheet is the first sheet of the workbook or it is not a worksheet, then the function returns a #Value error.

If you later copy this formula to a different sheet (say to Sheet 5), then it pulls up the value relative to its new location, which means it pulls up the value from Sheet4!A1.

You can also include a sheet name and the function will work just fine:


This version will always return Sheet2!A5 since sheet2 is the previous sheet of Sheet3.


If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12141) applies to Microsoft Excel 2007, 2010, 2013, and 2016. You can find a version of this tip for the older menu interface of Excel here: Relative Worksheet References.

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. ...


Developing Reciprocal Conversion Formulas

When converting between measurement systems, you might want to use two cells for each type of measurement. Make a change ...

Discover More

Backwards Date Parsing

Enter information into a worksheet, and you come to anticipate (and count on) how Excel will interpret that information ...

Discover More

Disappearing Column Formatting

Two things go into making your documents look just right: content and formatting. If the formatting seems to disappear on ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

More ExcelTips (ribbon)

Changing Your Name

One of the many pieces of information that Excel keeps track of is your name. If you want to change your name for Excel's ...

Discover More

Picking a Workbook Format

Need to share workbook information with a wide number of people? It can be puzzling to figure out which version of Excel ...

Discover More

Freezing Both Rows and Columns

When you are working in a worksheet, you may want to freeze the rows at the top or left of the worksheet. Excel provides ...

Discover More

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

View most recent newsletter.


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 five more than 6?

2021-08-17 04:35:17

Rene Boers

Another easy way to change the references is to use the "Indirect" function in the formula. In another cell you enter the sheet name, which the formula refers to. As an example, I have a summary sheet whereby each column collects information for one sheet only. For each column the sheet name which is being referenced, is shown in a cell at the top of that particular column. Whenever I have make a copy of an existing sheet, for a new project, I also copy an existing column on the summary sheet and change the reference cell at the top of the new column, to agree to the new sheet name.

2017-10-25 12:45:32

Lloyd Johnson

It's too bad Microsoft can't just incorporate this as a function into the program like Quattro Pro did a long time ago instead of us having to write macros.

2017-01-03 15:22:29

Steve Bondy

I tried this but kept getting a #Name error. For anyone else that runs into that, you MUST put the macro in a user module. In the VB editor click on the insert menu, then click on Module.

Paste the VB code into the newly created module, then it all works properly. You can't put the code in the "This Workbook" module, or in the module for one of the individual sheets. It must be in a user module.

See the first two steps of this article for further reference:

2016-07-15 11:40:49


I am trying to set this up and I keep getting #Value error. I set this up through the VBA which is what I assume you mean when you say create a macro. That is the only way it would work. PreSheet comes up but once I enter the cell vaule for the previous page I get the error. Please help, thanks

2015-11-01 00:44:01


Thanks, it's really useful.

2015-10-05 09:22:54


Thanks, I think this will will come in handy. In the past, I've relied on named references or used the INDIRECT function to simplify relative references across sheets, but both those options come with some overhead.

2015-08-26 02:45:42

Rajeswar Rao NLV

I have tried this exact macro and it worked for me. It has saved me from enormous work. PrevSheet function is working fine in Macro enable workbook of office 2007 and 2010.
Thank You ExcelTips.

2015-08-04 08:09:04


How would I modify this macro to skip hidden sheets..?

2015-02-17 11:46:25


I have tried this exact macro multiple times. I keep getting the return value of "#VALUE!". I know the macro is correct I have copied it from this website. Any ideas of what I could be doing wrong?

2013-03-20 11:20:39

Aldo Santolla

I tested the function and it actually does depend on the order of the tabs along the bottom. The function looks for the sheet previous to the sheet the function is used in. You will get a #VALUE! error if you use this function on the first sheet/tab of the series.

2013-03-19 14:12:53

Dennis Costello

In the above, "which worksheet is before it" depends of course not on the order of the tabs at the bottom of the window or the names of the worksheets, but their index numbers, which roughly translates to the order in which they were created. Sheet1, Sheet2, and Sheet3 are a special case in that when a new workbook is created, they have indices 1, 2, and 3.

2012-09-24 19:16:33


Nice one, thanks Allen

This Site

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

Newest Tips

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.