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
Can u help me with this.
=if(B2="","",vlookup(B2,'iw39',A:B,2,)),If(C2="","",vlookup(C2,'iw29',A:H,5,0))
if B2 is not available, i want to use the c2 to display the content coming from the sheet name IW39.
if the c2 is not available, i want to use the B2 to display the content coming from the sheet name IW29.
I will have 3 sheet. Namely "Data info", "IW39" AND "IW29"
Hi thanks for the tutorial. is there a way for you name the sheet that a formula is getting its information from.
for example im trying to find the cheapest vendor for a service i offer, their rates are on different work sheets, then i have a master sheet that displays the cheapest rates for each product using vlookup. is there a way of naming the sheet that vlookup has found the data in?
this would help me very much thank you.
how to auto calculate frieght total at end of the month by making daily transaction sheet to ledger sheet auto
I have a spreadsheet that pulls information from one tab to another based on an if then formula. Is there a way to lock the information on the third page once it has been recorded even if it is deleted from the original tab?
THanks!
Hi,
I have a sum that is derived using data from another workbook. However, when the other work book is closed. The formular reports an error.
Both files are in the same folder on my desktop. Kindly assist.
I need sheet 1 entire values in sheet 2.
Sheet 1 having datas but sheet 2 is empty in initial stage.
While we giving conditions in sheet 2, fetching datas in sheet 1 has to come automatically in sheet 2.
for example,
Sheet 1
Name Age Country
A 10 India
B 10 USA
C 10 India
I need in Sheet 2
Country = India datas
Name Age Country
Please do the needful for this
Hi,
Currently i am preparing a job sheet in which i required help.
As currently i have prepared 5 sheets in those sheets there are some different values or some similar values. Now i wanted to create one new sheet with such formula that if i will search any value then on that new sheet it will shows me the value location of all the 5 sheets that where it is placed. I wanted to do to save the time because for searching the values on whole workbook it consume time.
For ex: I have value of OD56782 on 3 sheets out of 5. Now whenever i entered OD56782 on the new sheet it will display the locations of this particular value.
I am linking a cell between worksheets in the same file. When I type the formula in the cell 'Sheet 1'!H11 the cell is populated with a 0 since the cell I am linking too is blank. How do I remove this 0 from the cell with the formula? The linked cell is blank until populated which will then be carried over to the other sheet.
Thanks
Dear
Sir, kindly make for me one formulla based sheet ( opening+receving-damage-consuption= 'closing) sheet plz let me how to make
Hi Svetlana,
I have a query that has me stumped. I am a bit of an excel novice so it may be nothing. I am currently trying to create a comprehensive meal planner/macronutrient calculator for my fitness training. What I want to do is have two separate sheets:
The first I want to be a table that has all the ingredients i use in the first column, and then the Fat/Carb/Cal/Protein contents (1% of) in the subsequent columns directly relating to the quantity column at the end so I can change this value and all the macros will change accordingly. This I have managed to do.
The second page, I want to have 6 individual tables laid out: INGREDIENT/CALORIES/CARBS/FAT/PROTEIN/QUANTITY. I would then like the ingredient column to be a drop down list that would include all the ingredients from the other sheet, and once selected, would autofill the remaining columns - this way I could easily add ingredients in the morning when I make up my meals for the day without having to individually input the stats. Any advice would be appreciated.
Thanks,
Dorian
Hi Svetlana,
Question: How to make an external reference and to get the full format from the referenced cell: number, alignment, font, border and fill formats? Is there a way or formula that can do that? The target is not to get only the value from the referenced cell, but also the apearence of that cell.
Thanks
Vasya
I have two different workbooks. One with data source MSFGS.xlsx and another one where I would like to count the number of items, say for a particular month 'November' from the MSFGS.xlsx
When the MSFGS.xlsx is closed the below formula is not working:
=COUNTIFS('C:\Users\Desktop\A\[MSFGS.xlsx]GSD'!F3:F93,">="&"1-11-2016", 'C:\Users\Desktop\A\[MSFGS.xlsx]GSD'!F3:F93,"<="&"30-11-2016")
But it returns a value when MSFGS is opened. Any error in the formula?
Thank you.
I have one worksheet which have external reference. I received this excel via email. When I click on cell formula shows as below
'\\s00697\team\Property Department\High Value Homeowners\Underwriting Guides & Rates\XXXX RATERS\[BGS HomeGuard Rate Sheet v2.01 0916.xlsx]Earthquake rates'
But I am not able to find BGS HomeGuard Rate Sheet v2.01 0916.xlsx.
Please help.
Thanks in advance,
Amit Chavda
Hey gang...If a cell is desired to be empty on sheet 1, how can I not have a zero populated on sheet 2?
I am having the same issue.
Wally this is what I used
='SHEETNAME'!CELLNUMBER&""
Hi i have define a few formula from sone external workbook. Is there any quick button or shortcut key for me to edit link of these external workbook to other external workbook?
Hi,
I'm trying to copy cells containing formulas into a new workbook, but I'm getting this error.
Formula copied from August Monthly Management Report_draft v2.33.xlsm
=IF(INDEX('EM raw'!$L3:$L18;sbrValue_EM_02)="";#N/A;INDEX('EM raw'!L3:L18;sbrValue_EM_02))
What gets pasted:
=IF(INDEX('[August Monthly Management Report_draft v2.33.xlsm]EM raw'!#REF!;sbrValue_EM_02)="";#N/A;INDEX('[August Monthly Management Report_draft v2.33.xlsm]EM raw'!#REF!;sbrValue_EM_02))
Any ideas?
Hi,
I want to use some values from the sheet1 in a purchase into another workbook's newsheet.
=[Purchase.xlsx]Sheet1!$A$5
This works but if i change the values in sheet1(source sheet) means value in the newsheet which values are extracted from sheet1 also getting changed. And i want to make it unchangeable in the new sheet.
Is there any possibilities for that?
Please help!
Thanks in advance
Hello Kishore,
In this case, replace the formulas with their values to break the connection between the extracted and original values. One of many possible ways to do this is Paste Special > Values (the detailed steps can be found here: How to copy values in Excel.
In case anyone else has a similar needs, I sorted this out by using Vlookup and define name for the range.
In fact I could use the same sheet and put them in difference columns but I would still need it to choose the correct column depending upon whether the number typed into the cell has a prefix of E or D
Hi,
Asking the question is probably more difficult than the answer, but here goes,
I am currently using this formula =LOOKUP(J4,'PIT Codes'!$A$2:$A$201,'PIT Codes'!$B$2:$B$201)
The user inputs a number and this references the sheet 'PIT Codes'to populate the sell with the corresponding code.
Unfortunately we have had to introduce another size of PIT so I was wondering if I can make it check one of 2 sheets 'PIT Codes E' and 'PIT Codes D' the difference will be that the user inputs E1 or D1 depending which they have used.