In Microsoft Excel, it’s a common task to refer to cells on other worksheets or even in different Excel files. At first, this can seem a little daunting and confusing, but once you understand how it works, it’s not so hard.

在Microsoft Excel中,引用其他工作表上甚至不同Excel文件中的单元格是一项常见的任务。 刚开始时,这似乎有些令人生畏和令人困惑,但是一旦您了解了它的工作原理,就没那么难了。

In this article, we’ll look at how to reference another sheet in the same Excel file and how to reference a different Excel file. We’ll also cover things like how to reference a cell range in a function, how to make things simpler with defined names, and how to use VLOOKUP for dynamic references.

在本文中,我们将研究如何在同一Excel文件中引用另一个工作表,以及如何引用另一个Excel文件。 我们还将介绍诸如如何在函数中引用单元格范围,如何通过定义的名称使事情更简单以及如何将VLOOKUP用于动态引用等内容。

如何在同一Excel文件中引用另一个工作表 (How to Reference Another Sheet in the Same Excel File)

A basic cell reference is written as the column letter followed by the row number.

基本单元格引用被写为列字母,后跟行号。

So the cell reference B3 refers to the cell at the intersection of column B and row 3.

因此,单元格引用B3指的是B列与第3行的交点处的单元格。

When referring to cells on other sheets, this cell reference is preceded with the other sheet’s name. For example, below is a reference to cell B3 on a sheet name “January.”

当引用其他工作表上的单元格时,此单元格引用之前是另一工作表的名称。 例如,下面是对工作表名称“ January”上的单元格B3的引用。

=January!B3

The exclamation point (!) separates the sheet name from the cell address.

感叹号(!)将工作表名称与单元格地址分隔开。

If the sheet name contains spaces, then you must enclose the name with single quotation marks in the reference.

如果工作表名称包含空格,则必须在引用中用单引号将该名称引起来。

='January Sales'!B3

To create these references, you can type them directly into the cell. However, it is easier and more reliable to let Excel write the reference for you.

要创建这些引用,您可以将它们直接键入到单元格中。 但是,让Excel为您编写参考更加容易和可靠。

Type an equal sign (=) into a cell, click on the Sheet tab, and then click the cell that you want to cross-reference.

在单元格中键入一个等号(=),单击“工作表”选项卡,然后单击要交叉引用的单元格。

As you do this, Excel writes the reference for you in the Formula Bar.

执行此操作时,Excel将在公式栏中为您编写参考。

Press Enter to complete the formula.

按Enter键完成公式。

如何引用另一个Excel文件 (How to Reference Another Excel File)

You can refer to cells of another workbook using the same method. Just be sure that you have the other Excel file open before you begin typing the formula.

您可以使用相同的方法引用另一个工作簿的单元格。 只需确保在开始键入公式之前已打开另一个Excel文件。

Type an equal sign (=), switch to the other file, and then click the cell in that file you want to reference. Press Enter when you’re done.

键入一个等号(=),切换到另一个文件,然后单击该文件中要引用的单元格。 完成后,按Enter键。

The completed cross-reference contains the other workbook name enclosed in square brackets, followed by the sheet name and cell number.

完整的交叉引用包含方括号内的其他工作簿名称,然后是工作表名称和单元格编号。

=[Chicago.xlsx]January!B3

If the file or sheet name contains spaces, then you’ll need to enclose the file reference (including the square brackets) in single quotation marks.

如果文件或工作表名称包含空格,则需要将文件引用(包括方括号)括在单引号中。

='[New York.xlsx]January'!B3

In this example, you can see dollar signs ($) amongst the cell address. This is an absolute cell reference (Find out more about absolute cell references).

在此示例中,您可以在单元格地址中看到美元符号($)。 这是绝对单元格引用(有关绝对单元格引用的更多信息)。

When referencing cells and ranges on different Excel files, the references are made absolute by default. You can change this to a relative reference if required.

当引用不同Excel文件上的单元格和范围时,默认情况下将引用设为绝对引用。 如果需要,可以将其更改为相对参考。

If you look at the formula when the referenced workbook is closed, it will contain the entire path to that file.

如果您在关闭引用工作簿时查看公式,它将包含该文件的完整路径。

Although creating references to other workbooks is straightforward, they are more susceptible to issues. Users creating or renaming folders and moving files can break these references and cause errors.

尽管创建对其他工作簿的引用很简单,但是它们更容易出现问题。 用户创建或重命名文件夹以及移动文件可能会破坏这些引用并导致错误。

Keeping data in one workbook, if possible, is more reliable.

如果可能,将数据保存在一个工作簿中会更可靠。

如何交叉引用函数中的单元格范围 (How to Cross Reference a Cell Range in a Function)

Referencing a single cell is useful enough. But you might want to write a function (such as SUM) that references a range of cells on another worksheet or workbook.

引用单个单元格就足够了。 但是您可能想编写一个引用另一个工作表或工作簿上的单元格范围的函数(例如SUM)。

Start the function as usual and then click on the sheet and the range of cells—the same way you did in the previous examples.

照常启动该功能,然后单击工作表和单元格范围,方法与前面的示例相同。

In the following example, a SUM function is summing the values from range B2:B6 on a worksheet named Sales.

在下面的示例中,一个SUM函数对名为Sales的工作表上的范围B2:B6的值求和。

=SUM(Sales!B2:B6)

如何为简单的交叉引用使用定义的名称 (How to Use Defined Names for Simple Cross References)

In Excel, you can assign a name to a cell or range of cells. This is more meaningful than a cell or range address when you look back at them. If you use a lot of references in your spreadsheet, naming those references can make it much easier to see what you’ve done.

在Excel中,您可以为一个单元格或单元格区域分配一个名称。 当您回顾它们时,这比单元格或范围地址更有意义。 如果您在电子表格中使用了大量引用,则对这些引用进行命名可以使您更轻松地查看已完成的操作。

Even better, this name is unique for all the worksheets in that Excel file.

更好的是,该名称对于该Excel文件中的所有工作表都是唯一的。

For example, we could name a cell ‘ChicagoTotal’ and then the cross-reference would read:

例如,我们可以将单元格命名为“ ChicagoTotal”,然后交叉引用将显示为:

=ChicagoTotal

This is a more meaningful alternative to a standard reference like this:

这是像这样的标准参考的更有意义的替代方法:

=Sales!B2

It’s easy to create a defined name. Start by selecting the cell or range of cells that you want to name.

创建定义的名称很容易。 首先选择要命名的单元格或单元格范围。

Click in the Name Box in the top left corner, type the name you want to assign, and then press Enter.

单击左上角的名称框,键入要分配的名称,然后按Enter。

When creating defined names, you cannot use spaces. Therefore, in this example, the words have been joined in the name and separated by a capital letter. You could also separate words with characters like a hyphen (-) or underscore (_).

创建定义的名称时,不能使用空格。 因此,在此示例中,单词已加入名称并以大写字母分隔。 您还可以使用连字符(-)或下划线(_)等字符分隔单词。

Excel also has a Name Manager that makes monitoring these names in the future easy. Click Formulas > Name Manager. In the Name Manager window, you can see a list of all of the defined names in the workbook, where they are, and what values they currently store.

Excel还具有一个名称管理器,使将来监视这些名称变得容易。 单击公式>名称管理器。 在“名称管理器”窗口中,您可以看到工作簿中所有已定义名称的列表,它们的位置以及它们当前存储的值。

You can then use the buttons along the top to edit and delete these defined names.

然后,您可以使用顶部的按钮来编辑和删除这些定义的名称。

如何将数据格式化为表格 (How to Format Data as a Table)

When working with an extensive list of related data, using Excel’s Format as Table feature can simplify the way that you reference data in it.

当使用大量相关数据列表时,使用Excel的“表格格式”功能可以简化在其中引用数据的方式。

Take the following simple table.

拿下面的简单表。

This could be formatted as a table.

可以将其格式化为表格。

Click on a cell in the list, switch to the “Home” tab, click the “Format as Table” button, and then select a style.

单击列表中的单元格,切换到“主页”选项卡,单击“设置为表格格式”按钮,然后选择一种样式。

Confirm that the range of cells is correct and that your table has headers.

确认单元格的范围是正确的,并且表具有标题。

You can then assign a meaningful name to your table from the “Design” tab.

然后,您可以从“设计”选项卡中为表分配一个有意义的名称。

Then, if we needed to sum the sales of Chicago, we could refer to the table by its name (from any sheet), followed by a square bracket ([) to see a list of the table’s columns.

然后,如果我们需要对芝加哥的销售额进行汇总,则可以通过其名称(从任何工作表中引用)来引用该表,然后使用方括号([)来查看该表的列的列表。

Select the column by double-clicking it in the list and enter a closing square bracket. The resulting formula would look something like this:

在列表中双击以选择该列,然后输入一个方括号。 结果公式如下所示:

=SUM(Sales[Chicago])

You can see how tables can make referencing data for aggregation functions such as SUM and AVERAGE easier than standard sheet references.

您可以看到表如何使聚合功能(例如SUM和AVERAGE)的引用数据比标准图纸引用更容易。

This table is small for the purposes of demonstration. The larger the table and the more sheets you have in a workbook, the more benefits you’ll see.

该表很小,仅用于演示目的。 表格越大,工作簿中的表格越多,您将看到更多的好处。

如何将VLOOKUP函数用于动态引用 (How to Use the VLOOKUP Function for Dynamic References)

The references used in the examples thus far have all been fixed to a specific cell or range of cells. That’s great and is often sufficient for your needs.

到目前为止,示例中使用的参考文献都已固定到特定的单元格或单元格范围。 很好,通常足以满足您的需求。

However, what if the cell you are referencing has the potential to change when new rows are inserted, or somebody sorts the list?

但是,如果您要引用的单元格在插入新行或有人对列表进行排序时可能会发生变化,该怎么办?

In those scenarios, you could not guarantee the value you want will still be in the same cell that you initially referenced.

在这些情况下,您不能保证所需的值仍将位于最初引用的同一单元格中。

An alternative in these scenarios is to use a lookup function within Excel to search for the value in a list. This makes it more durable against changes to the sheet.

在这些情况下,一种替代方法是在Excel中使用查找功能来搜索列表中的值。 这使得它更耐用,不会更改纸张。

In the following example, we use the VLOOKUP function to look up an employee on another sheet by their employee ID and then return their start date.

在下面的示例中,我们使用VLOOKUP函数通过员工ID在另一个工作表上查找员工,然后返回其开始日期。

Below is the example list of employees.

下面是示例雇员列表。

The VLOOKUP function looks down the first column of a table and then returns information from a specified column to the right.

VLOOKUP函数向下看表的第一列,然后从右边的指定列返回信息。

The following VLOOKUP function searches for the employee ID entered into cell A2 in the list shown above and returns the date joined from column 4 (fourth column of the table).

以下VLOOKUP函数在上面显示的列表中搜索输入到单元格A2中的员工ID,并返回从第4列(表的第四列)加入的日期。

=VLOOKUP(A2,Employees!A:E,4,FALSE)

Below is an illustration of how this formula searches the list and returns the correct information.

下面是此公式如何搜索列表并返回正确信息的说明。

The great thing about this VLOOKUP over the previous examples is that the employee will be found even if the list changes in order.

与之前的示例相比,此VLOOKUP的优点在于,即使列表按顺序更改,也将找到该员工。

Note: VLOOKUP is an incredibly useful formula, and we’ve only scratched the surface of its value in this article. You can find out more about how to use VLOOKUP from our article on the subject.

注意: VLOOKUP是一个非常有用的公式,在本文中我们仅涉及其值的表面。 您可以从有关该主题的文章中找到有关如何使用VLOOKUP的更多信息。



In this article, we have looked at multiple ways to cross-reference between Excel spreadsheets and workbooks. Choose the approach that works for your task at hand, and that you feel comfortable working with.

在本文中,我们研究了在Excel电子表格和工作簿之间进行交叉引用的多种方法。 选择适合您手头任务的方法,并让您感到自在。

翻译自: https://www.howtogeek.com/426633/how-to-cross-reference-cells-between-microsoft-excel-spreadsheets/

如何在Microsoft Excel电子表格之间交叉引用单元格相关推荐

  1. php把1拆分成三份,谁知道Excel电子表格怎么把一个单元格分3份(分成3个三角)! | excle表格怎么分割三份...

    请问,excel表格的单元格怎么一分为二或一分为三,是拆分,与合并无关,请高手指教 excel拆分已合并的格的步骤: 三行单元格目前处于一个单元格状态. 选还原的单元格,右键鼠标,在工具栏中选择快捷转 ...

  2. Excel如何根据数字引用单元格,并返回单元格的值

    在计算投资回收期的时候遇到一个问题,需要根据累计现金流回正的那一年去计算小数点后的数字. 例如,每年净现金流是3,累计现金流是-10,-7,-4,-1,2,5,这时候回收期就是4-(-1)/2.B3单 ...

  3. 如何在 Excel 中对齐或旋转单元格中的文本?

    欢迎观看 Microsoft Excel 教程,小编带大家学习 Microsoft Excel的使用技巧,了解如何在 Excel 中对齐或旋转单元格中的文本. 在 Excel 中,对齐或旋转单元格的文 ...

  4. poi 合并单元格添加边框_如何在Excel中的文本和单元格边框之间添加空间

    poi 合并单元格添加边框 Adding a bit of extra padding to your cell boundaries can make it easier for you to re ...

  5. EXCEL引用单元格的几种格式

    XCEL最强大的功能便是公式,使用公式必须用到引用单元格,EXCEL单元格的引用分为A1引用.R1C1引用,R1C1引用一般很少使用,我们通常更喜欢A1引用,今天小编分享A1引用单元格的几种格式: 工 ...

  6. Excel技能培训-INDIRECT实现拼接动态引用单元格,trl+pageDown速切换工作簿,多工作表求和,多个工作簿合并和拆分

    1. 使用INDIRECT实现拼接动态引用单元格内容 =INDIRECT("E"&COUNTA(G14:G17)) 2. 使用ctrl+pageUp ,ctrl+pageD ...

  7. 如何在EXCEL中查找多个单元格中的多个关键字,多个单元格满足多个条件的行的绿色在线工具

    Excel查找,偶尔有情况遇到要在Excel中查找多个单元格的多个关键字(或包含或相等),或多个单元格或列满足多个的条件的行,Excel本身的支撑没有那么灵活.本身我们又对代码不熟悉,有一个方便性的工 ...

  8. wps单元格内怎样批量换行_wps里excel怎么换行在同一单元格内

    wps里excel怎么换行在同一单元格内 相信很多小伙伴在日常办公中都会用到Excel,在同一个单元格内如何才能进行换行操作呢?方法很简单,下面小编就来为大家介绍. 方法一: 1. 首先,打开电脑上的 ...

  9. php利用表格敬将所选择的数据显示出来,单元格下拉筛选设置/Excel对筛选后的单元格进行下拉填充...

    EXCEL里怎样让一个单元格能有下拉菜单? 要设置下拉菜单的单元格(或格区)----数据---有效---"允许"中选择"序"---"来源"中 ...

  10. 计算机表格怎么同时选中分开的两项,excel怎么把三个单元格分成两个

    1. excel表 三个表格合并后怎么拆分成两个 1.首先我们鼠标点击选中要拆分的大单元格 2.然后鼠标右击它,在在弹出的选项点击[设置单元格格式] 3.接着我们点击窗口上端的[对齐] 4.现在我们把 ...

最新文章

  1. Anaconda 环境下 对Tushare进行测试
  2. 酸了!第一名+第三名的学霸情侣,分别直博清华、人大…
  3. mockito模拟依赖注入_使用Mockito模拟自动装配的字段
  4. 华为机试HJ90:合法IP
  5. 程序人生:做技术,切不可沉湎于技术
  6. php如何连接mariadb,MariaDB 建立连接
  7. Android SDK 和 JDK 安装
  8. Windows下使用CMD下载网络文件
  9. 编译原理:上下文无关文法 CFG
  10. 从零开始的unity3d入门教程(二)----基本功能讲解
  11. 《软件测试》第九章 兼容性测试
  12. 【思考】阿里云的混合云战略,凭啥扯上Zstack?
  13. dmz和端口映射_主机映射和端口映射 ip映射和端口映射区别
  14. ChatGPT 是什么?
  15. git版本回退(git reset、git revert、git stash)
  16. Android 集成百度身份证识别
  17. 构建Oracle高可用环境HA rac:企业级高可用数据库架构、实战与经验总结
  18. 让心爱的TA不再孤单——Python微信聊天机器人
  19. 中国植入式起搏器市场趋势报告、技术动态创新及市场预测
  20. 财务报表是用来排雷的-《手把手教你读财报》

热门文章

  1. FBEC2020 | 贾瑶琪:打造区块链项目最好的方式,是打造开源的系统
  2. 虚幻5会对行业产生什么重大变化影响?
  3. 【pytorch基础学习笔记】零基础速成,了解pytorch基础语法和应用
  4. 华研计算机系统苹果用不了,系统瘦身:Apple 苹果 在 macOS Catalina 中取消 Dashboard...
  5. android studio连接模拟器 mumu模拟器,雷电模拟器,夜神模拟器
  6. java nginx 502_Nginx 中 502 和 504 错误详解
  7. 求最大公约数 最大公因数 语言实现输出一个整数的最大公约数(因数),四种算法实现
  8. 轮廓检测论文解读 | 整体嵌套边缘检测HED | CVPR | 2015
  9. Tableau详细安装教程【踩坑】
  10. java如何知道城市是省会_全国各省的省会都是怎么确定的?