This short tutorial explains the basics of an external reference in Excel, and shows how to reference another sheet and workbook in your formulas.
When calculating data in Excel, you may often find yourself in a situation when you need to pull data from another worksheet or even from a different Excel file. Can you do that? Of course, you can. You just need to create a link between the worksheets (within the same workbook or in different workbooks) by using what is called an external cell reference or a link.
External reference in Excel is a reference to a cell or a range of cells outside the current worksheet. The main benefit of using an Excel external reference is that whenever the referenced cell(s) in another worksheet changes, the value returned by the external cell reference is automatically updated.
Although external references in Excel are very similar to cell references, there are a few important differences. In this tutorial, we'll start with the basics and show how to create various external reference types with detailed steps, screenshots and formula examples.
How to reference another sheet in Excel
To reference a cell or range of cells in another worksheet in the same workbook, put the worksheet name followed by an exclamation mark (!) before the cell address.
In other words, in an Excel reference to another worksheet, you use the following format:
Reference to an individual cell:
For example, to refer to cell A1 in Sheet2, you type Sheet2!A1.
Reference to a range of cells:
For example, to refer to cells A1:A10 in Sheet2, you type Sheet2!A1:A10.
Note. If the worksheet name includes spaces or non-alphabetical characters, you must enclose it in single quotation marks. For example, an external reference to cell A1 in a worksheet named Project Milestones should read as follows: 'Project Milestones'!A1.
In a real-life formula, which multiplies the value in cell A1 in 'Project Milestones' sheet by 10, an Excel sheet reference looks like this:
='Project Milestones'!A1*10
Creating a reference to another sheet in Excel
When writing a formula that refers to cells in another worksheet, you can of course type that other sheet name followed by an exclamation point and a cell reference manually, but this would be a slow and error-prone way.
A better way is point to the cell(s) in another sheet that you want the formula to refer to, and let Excel take care of the correct syntax of your sheet reference. To have Excel insert a reference to another sheet in your formula, do the following:
- Start typing a formula either in a destination cell or in the formula bar.
- When it comes to adding a reference to another worksheet, switch to that sheet and select a cell or a range of cells you want to refer to.
- Finish typing the formula and press the Enter key to complete it.
For example, if you have a list of sales figures in sheet Sales and you want to calculate the Value Added Tax (19%) for each product in another sheet named VAT, proceed in the following way:
- Start typing the formula =19%* in cell B2 on sheet VAT.
- Switch to sheet Sales, and click on cell B2 there. Excel will immediately insert an external reference to that cell, as shown in the following screenshot:
- Press Enter to complete the formula.
Note. When adding an Excel reference to another sheet using the above method, by default Microsoft Excel adds a relative reference (with no $ sign). So, in the above example, you can just copy the formula to other cells in column B on sheet VAT, the cell references will adjust for each row, and you will have VAT for each product correctly calculated.
In a similar manner, you can reference a range of cells in another sheet. The only difference is that you select multiple cells on the source worksheet. For example, to find out the total of sales in cells B2:B5 on sheet Sales, you would enter the following formula:
=SUM(Sales!B2:B5)
This is how you reference another sheet in Excel. And now, let's see how you can refer to cells from a different workbook.
How to reference another workbook in Excel
In Microsoft Excel formulas, external references to another workbook are displayed in two ways, depending on whether the source workbook is open or closed.
External reference to an open workbook
When the source workbook is open, an Excel external reference includes the workbook name in square brackets (including the file extension), followed by the sheet name, exclamation point (!), and the referenced cell or a range of cells. In other words, you use the following reference format for an open workbook reference:
For example, here's an external reference to cells B2:B5 on sheet Jan in the workbook named Sales.xlsx:
[Sales.xlsx]Jan!B2:B5
If you want, say, to calculate the sum of those cells, the formula with the workbook reference would look as follows:
=SUM([Sales.xlsx]Jan!B2:B5)
External reference to a closed workbook
When you reference another workbook in Excel, that other workbook does not necessarily need to be open. If the source workbook is closed, you must add the entire path to your external reference.
For example, to add up cells B2:B5 in the Jan sheet from Sales.xlsx workbook that resides within the Reports folder on drive D, you write the following formula:
=SUM(D:\Reports\[Sales.xlsx]Jan!B2:B5)
Here's a breakdown of the reference parts:
- File Path. It points to the drive and directory in which your Excel file is stored (D:\Reports\ in this example).
- Workbook Name. It includes the file extension (.xlsx, .xls, or .xslm) and is always enclosed in square brackets, like [Sales.xlsx] in the above formula.
- Sheet Name. This part of the Excel external reference includes the sheet name followed by an exclamation point where the referenced cell(s) is located (Jan! in this example).
- Cell Reference. It points to the actual cell or a range of cells referenced in your formula.
If you've created an reference to another workbook when that workbook was open, and after that you closed the source workbook, your external workbook reference will get updated automatically to include the entire path.
Note. If either the workbook name or sheet name, or both, include spaces or any non-alphabetical characters, you must enclose the path in single quotation marks. For example:
=SUM('[Year budget.xlsx]Jan'!B2:B5)
=SUM('[Sales.xlsx]Jan sales'!B2:B5)
=SUM('D:\Reports\[Sales.xlsx]Jan sales'!B2:B5)
Making a reference to another workbook in Excel
As is the case with creating an Excel formula that references another sheet, you don't have to type a reference to a different workbook manually. Just switch to the other workbook when entering your formula, and select a cell or a range of cells you want to refer to. Microsoft Excel will take care of the rest:
Notes:
- When creating a reference to another workbook by selecting the cell(s) in it, Excel always inserts absolute cell references. If you intend to copy the newly created formula to other cells, be sure to remove the dollar sign ($) from the cell references to turn them into relative or mixed references, depending on your purposes.
- If selecting a cell or range in the referenced workbook does not automatically create a reference in the formula, most likely the two files are open in different instances of Excel. To check this, open Task Manager and see how many Microsoft Excel instances are running. If more than one, expand each instance to view which files are nested there. To fix the issue, close one file (and instance), and then open it again from the other file.
Reference to a defined name in the same or another workbook
To make an Excel external reference more compact, you can create a defined name in the source sheet, and then refer to that name from another sheet that resides in the same workbook or in a different workbook.
Creating a name in Excel
To create a name in Excel, select all the cells you want to include, and then either go to the Formulas tab > Defined names group and click the Define name button, or press Ctrl + F3 and click New.
In the New Name dialog, type any name you want (remember that spaces are not allowed in Excel names), and check if the correct range is displayed in the Refers to field.
For example, this is how we create a name (Jan_sales) for cells B2:B5 in Jan sheet:
Once the name is created, you are free to use it in your external references in Excel. The format of such references is much simpler than the format of an Excel sheet reference and workbook reference discussed earlier, which makes the formulas with name references easier to comprehend.
Note. By default, Excel names are created for the workbook level, please notice the Scope field in the screenshot above. But you can also make a specific worksheet level name by choosing a corresponding sheet from the Scope drop-down list. For Excel references, the scope of a name is very important because it determines the location within which the name is recognized.
It's recommended that you always create workbook-level names (unless you have a specific reason not to), because they significantly simplify creating Excel external references, as illustrated in the following examples.
Referencing a name in another sheet in the same workbook
To reference a global workbook-level name in the same workbook, you simply type that name in a function's argument:
For example, to find the sum of all the cells within the Jan_sales name that we created a moment ago, use the following formula:
=SUM(Jan_sales)
To reference a local worksheet-level name in another sheet within the same workbook, you need to precede the name with the sheet name followed by an exclamation mark:
=Function(Sheet_name!name)
For example:
=SUM(Jan!Jan_sales)
If the sheet names includes spaces or mon-alphabetic chars, remember to enclose it in single quotes, e.g.:
=SUM('Jan report'!Jan_Sales)
Referencing a name in another workbook
A reference to a workbook-level name in a different workbook consists of the workbook name (including the extension) followed by an exclamation point, and the defined name (named range):
For example:
=SUM(Sales.xlsx!Jan_sales)
To reference a worksheet-level name in another workbook, the sheet name followed by the exclamation point should be included as well, and the workbook name should be enclosed in square brackets. For example:
=SUM([Sales.xlsx]Jan!Jan_sales)
When referencing a named range in a closed workbook, remember to include the full path to your Excel file, for example:
=SUM('C:\Documents\Sales.xlsx'!Jan_sales)
How to create an Excel name reference
If you have created a handful of different names in your Excel sheets, you don't need to remember all those names by heart. To insert an Excel name reference in a formula, perform the following steps:
- Select the destination cell, enter the equal sign (=) and start typing your formula or calculation.
- When it comes to the part where you need to insert an Excel name reference, do one of the following:
- If you are referring to a workbook-level name from another workbook, switch to that workbook. If the name resides in another sheet within the same workbook, skip this step.
- If you are making a reference to a worksheet-level name, navigate to that specific sheet either in the current or different workbook.
- Press F3 to open the Past Name dialog window, select the name you want to refer to, and click OK.
- Finish typing your formula or calculation and press the Enter key.
Now that you know how to create an external reference in Excel, you can take a benefit from this great ability and use data from other worksheets and workbooks in your calculations. I thank you for reading and look forward to seeing you on our blog next week!
358 comments
I have a question regarding whether you can reference multiple ranges of cells that are scattered throughout another sheet, without having to go line by line.
This has been working so far but I have over 6,000 rows and many more cells that I need to reference.
For example:
='Table 1'!A34:P34
='Table 1!A64:P64
='Table 1'!A65:P65
='Table 1'!A81:P81
='Table 1'!A86:P86
='Table 1'!A94:P94
='Table 1'!A118:P118
='Table 1'!A119:P119
........
Hi! If these references do not have a logical sequence, you can either create them manually or use the INDIRECT function.
Hi,
I have a workbook containing 2 sheets - 'Sheet A' and 'Sheet B'. In 'Sheet B' I have a value in cell F1. In 'Sheet A" I have a cell which is pointing to the value in 'Sheet B" cell F1 (='Sheet B'!F1). I always want to retrieve the value from this exact cell "F1". But daily I am inserting a new column to the left of column F in Sheet B containing a different value. This is causing the cell referenced from Sheet A to change to G1, H1, etc. whenever I insert a new column. I have tried placing a $ sign before "F" and "1" in reference from Sheet A (i.e., ='Sheet B'!$F$1), but this does not work. Do you have a solution to this problem? Thanks in advance for any help you may provide.
Hi! To create a reference that always refers to the desired cell, use the INDIRECT function. You can find the examples and detailed instructions here: Using Excel INDIRECT function to lock a cell reference.
For example:
=INDIRECT("'Sheet B'!F1")
Alexander, thanks for the resolution to my problem!
Thank you so much for this useful information and for your kind words
I am trying to use a formula to insert the name of a sheet into the reference.
Lets say my formula that references the other sheet is
=+'Objective 2'!F$2
But instead of typing 'Object 2' into the formula, I have "Objective 2" and other sheet names in other cells in the current sheet.
So I want to replace "Objective 2" with a cell reference. Can I do this?
Something like
=+'B4'!F$2 Where the value in cell B4 is "Objective 2"
Thanks
Hi! To create a dynamic cell reference, use the INDIRECT function and this guide: Creating an Excel dynamic reference to another sheet. Hope this is what you need.
Hi,
I have a formula for a budget excel sheet and I'm trying for one month per sheet in one file. But when i duplicate the page, the formula is linked to the first page and does not show the result to the page I'm on.
Here's the formula : =CONCATENER("Solde : "&TEXTE(@Solde,"[Vert]# ##0,00 $;[Rouge]-# ##0,00 $"))
I tried to put the reference page at the beginning of the formula but it didn't work.
Thank you
Hi! I can't understand and test a formula that contains unique references to data that I don't have. In addition, I do not have French Excel regional settings.
I assume that the formula uses a reference to the named range Solde, which is on the first worksheet.
I want to take an excel file with many columns and data and created an additional file referring to only a select number of columns from the original file.
Hi! You can get some of the data from your table by using the FILTER function. Read more: Excel FILTER function - dynamic filtering with formulas. You can also try using pivot table to get some of the data and select individual columns.
I am using Excel to build a database for keeping track of observations in my observatory. The workbook contains three tables in separate sheets; Stars, Observations and Names. The Stars table and the Names table are both indexed by an integer 'Star ID' (I need the Names table because stars have multiple names). The Names table also includes a field 'TheSky' which tells me the filename prefix for images of the given star. The Observations table is indexed by an integer 'Observations ID'. It includes a field for 'Star ID' and a field for 'TheSky' which I want to update automatically for the observed star.
What would be the correct formula to put in the 'TheSky' field of the Observations table so that it will display the text from 'TheSky' field in the Names table for the corresponding 'Star ID'?
Thank you for any ideas you may have.
Hi! Without seeing your data, it is impossible to give you a formula. To find the text from the 'TheSky' field that matches 'Star ID', use INDEX MATCH.
I also recommend that you pay attention to the Vlookup Wizard. The intuitive wizard will walk you through the steps to building a formula and help you define all the arguments. It is available as a part of our Ultimate Suite for Excel that you can install in a trial mode and check how it works for free.
I hope it’ll be helpful. If something is still unclear, please feel free to ask.
Hello!
I have 2 sheets (01, 02).
Sheet 02 contains a cell with a reference to a cell on sheet 01 (='01'!D3).
When i copy (dragging) sheet 02 and make sheet 03, reference on sheet 03 stay the same (='01'!D3)!!!!
I need the reference to change automatically to ='02'!D3.
Is this possible?
OpenOffice do it automatically, but i'm trying to switch to Excel.
Thank you very much!
Hi! When you copy references in Excel, only relative cell references are dynamically changed.
Hello! Thnx for answer.
I copy relative references! But i copy sheet. And it doesnt dynamically change. When i copy (dragging) sheet 02 and make sheet 03, reference on sheet 03 stay the same (='01'!D3)!!!!
I need the reference to change automatically to ='02'!D3.
Worksheet references are not relative cell references. They do not change when you copy them.
Hello, I'm trying to create a master spreadsheet which is compiled of different sections of data from different people. So for example Person A has a section which they can update and feeds automatically into the master spreadsheet, as can Person B for a different section. Each person can only see their own section but those with the master spreadsheet can see it all, is this possible?
Hi!
I need to take figures from one spreadsheet and figures from another spreadsheet and put them together on another spreadsheet. The problem is that I am doing monthly work and at the end of the month I have a few days that need to be added into the first week of the next month on another report. So I have a spreadsheet that takes the number automatically. But I can't get the 1st weeks numbers in because I can not figure out how to get the end of the month number from the month before and the current end of month numbers to merge together for the first week. I keep reading everything here but there is no plain and simple way here on how to do something like that.
Does anyone have an easy and simple trick to get both months number on one spreadsheet. I would really appreciated it. Because whoever did this before kept totals in a book. Pen and paper and I do not wish to do that....lol!!
Thanks for any help anyone can give me!!!!
Hi.
I created a data extraction file that is using filter function to pull data from a master workbook. It has a "list" that can be filtered and generate a list referencing to the master sheet.
I am trying to make the external reference work while the workbook is closed. The master and extraction files sit at the same path on sharepoint and I did put the exact path to the file: "https://location/location/location/file.xlsx". So the path would be 'https://location/location/file.xls!Table1
When I have the master file open, the function it will only indicate the file name, but when I close the master, the entire file path shows. However, the filter and file exaction won't work. Any help would be appreciated so that the filtered file will work without the master file open.
I am wondering if it's not working because it's on sharepoint.
Hi! Pay attention to the following paragraph of the article above: External reference to a closed workbook.
Here is what I have:
=CHOOSECOLS(VSTACK('https://filelocation/filename.xlsx'!Table1[#Headers],SORT(FILTER('https://filelocation/filename.xlsx'!Table1[#Data], 'https://filelocation/filename.xlsx'!Table1[Filtercondition]=C2,""),{4,7,1},1)),6,8,7,4,1,2,18,19,20)
I included the brackets [ ] for the file name. But still getting #REF error. For the cell reference, can it be a table for a closed book reference? Or does it have to specify the cells?
=CHOOSECOLS(VSTACK('https://filelocation/[filename.xlsx]Sheet Name'!Table1[#Headers],SORT(FILTER(' https://filelocation/%5Bfilename.xlsx%5DSheet Name'!Table1[#Data], 'https://filelocation/[filename.xlsx]Sheet Name'!Table1 [Selected Column name]=C2,""),{4,7,1},1)),6,8,7,4,1,2,18,19,20)
Hi Shanna,
I would advise you to build the formula having both workbooks open and selecting the ranges and cells in the second workbook using the mouse. In this case, Excel will use the appropriate references automatically. After you close that second workbook, your external reference will get updated automatically to include the entire path to the file.
I want to create an active spread sheet which will pick up values from different columns in the master sheet with a condition. Can anyone help.
E.g. Column A in active spread sheet should pick up value from column G of master spread sheet with a condition that it picks up on the open tasks to the active sheet. How to do that.
Hi! If you want to get multiple records from a table based on some condition, I recommend using the FILTER function and the examples in these instructions: Excel FILTER function - dynamic filtering with formulas.
Hi
Kindly assist with a function that will give me the counts from other sheet, I have sheet 1 which has Cell B1 and E1 where I select my criteria as dates then I have sheet2 where my data is. I want to get the counts of records in Sheet 2 which match the date range selected in Sheet 1 Cell B1 and E1. here is the functions that I tried
=COUNTIFS(Sheet2!D3:D9,(Sheet2!C3:D9>=B1)*(SHeet2!C3:D9=B1")-COUNTIF(Sheet2!C3:D9,"="&B1)-COUNTIF(Sheet!D3:D9,"<="&E1)
None of these are working for me
Thank you
Hi! Learn the syntax of the COUNTIFS function carefully. See the examples in this article: How to count cells with multiple criteria. Also note that COUNTIFS function arguments cannot be formulas. Also note that all cell ranges in a COUNTIFS formula must have the same size. Simultaneous use of C3:D9 and D3:D9 is not allowed.
I can't recommend a formula to you as I can't see your data.
Hello! Thank you for this. Do you know of a way to have just the formula linked to other workbooks? For instance, if I have a cell that calculates the sum of a list on one spreadsheet, is there a way to copy the formula to other spreadsheets such that, when I update the formula on the first (like, maybe i decide to divide the result by 2), the formula on the others also updates (so they also now divide the results of their sums by 2)?
Hi! An Excel formula cannot automatically change if another formula of the same type changes. You can write the values that change in separate cells and make references to these cells from all formulas.
that wouldn't work for what i'm trying to do, but thanks for the quick response! :)
After I create my external links from multiple external workbooks into one workbook on a shared drive, I get a #Value error when the external workbooks are closed. When I open them, it will update on the main workbook. Can you please help with me the formula where the workbook will still show the values without the other workbooks being open. I used the =countif(range,"V") formula. I would like for it to continue to update and display the values without the other workbooks being open. Thank you
Hi! Pay attention to the following paragraph of the article above: External reference to a closed workbook. I hope it’ll be helpful.
Hi, I have a doubt on these references,
Consider I have 2 working excel files. One is Master data file (excel_1) and the another excel file which I am working on currently (excel_2) where I took references from (excel_1) file for some data. Now I have closed both the files.
Now, When I 1st open my current working excel file (excel_2), everything is working fine. But when I open the Master data file (excel_1), all the cells in the excel_2 which has references from excel_1 has turned into #N/A errors. How could I solve this type of issue? I need to get dynamic values from my Master data always (excel_1) into excel_2.
Thanks
Hi! Unfortunately, I have not been able to reproduce your problem. I don't know what actions you performed with the file and which formulas return the error.
Hi
I'd like to create an Excel template with the ability to attach items from another Excel file. For example, a serial number is entered into the template and all the information for this item (price, description, image, etc.) is linked from another Excel file.
Hi! Maybe this article will be helpful: VLOOKUP across multiple sheets in Excel with examples.
Hi,
I'm trying to set up a spreadsheet of information that has multiple sheets. Sheets 1 and 2 will always be the same. Sheet 3 will be a 'review' spreadsheet. There may be multiple 'review' sheets that I need to insert weekly (an indefinite number), and so want to create a template that I can copy and pull into place. Is there a way I can set a formula to autopull information through from a cell on the previous sheet to the left hand side when I don't know what that sheet will be called?
Hi! You can create a dynamic reference to another worksheet in your workbook using the INDIRECT function. See here for a detailed instruction: Excel INDIRECT function - basic uses and formula examples.
Hello ! I have a workbook with two sheets. In the first sheet (DAY TIME) I get values from the second sheet (GET VALUES) using =INDEX(GET_DATA!$M$5:$M$1004;MATCH('DAY TIME'!$G$6;GET_DATA!$L$5:$L$1004;1))
This extends from M to AU.
I want to dynamically change the range of my search by just changing the values of two cells.
Meaning for example in sheet1, in cell B2 I will input the number 305 and in the cell B3 the number 519 and the formula will lookup in M305:M519 and L305:L519 of sheet 2.
I am trying with INDIRECT but I can't seem to find a work around.
Hi! To create a dynamic link to another sheet using cells B2 and B3, use this formula:
INDIRECT("GET_DATA!$M$" & B2 & ":$M$" & B3)
instead of
GET_DATA!$M$5:$M$1004
You can find the examples and detailed instructions here: INDIRECT formula to dynamically refer to another worksheet.
Can I use a formula to refer to a cell in a sheet rather than the cell.
Eg. Rather than ='BSCA|P'!Q17 (which is data for todays date) when I do something like ='BSCA|P'!VAR!E18 (VARSheet being a sheet which tracks the cells for Todays date) I keep getting a 'There's an error in the formula you entered' message.
Thanks,
Rohan
Hi! To create reference from cell value, try using the INDIRECT function. I recommend reading this guide: How to use INDIRECT function in Excel - formula examples.