简体   繁体   English

Excel:将一个表的列的数据链接到另一工作簿中的表

[英]Excel: Linking the data of one Table's column to Table in another Workbook

Thank you for reading my question. 感谢您阅读我的问题。

I am looking to replicate certain columns (eg columns A,D,F) from a table (eg TableX) DYNAMICALLY to a set of columns (eg columns H, J, K) in a second table (Table Y) in a second workbook (Workbook 2). 我正在寻找将表(例如TableX)中的某些列(例如A,D,F)动态复制到第二个工作簿的第二个表(表Y)中的一组列(例如H,J,K列) (练习册2)。

I want to make sure the link is live between the two, and that if I delete or add rows to Table 1, Table 2 automatically expands/retracts to represent the same number of entries. 我想确保两者之间存在链接,并且如果我在表1中删除或添加行,表2会自动展开/缩回以表示相同数量的条目。

I have tried linking the tables, but I end up with !REF errors. 我尝试链接表,但最终出现!REF错误。 I have tried Linking Named Ranges, but I seem to lose expansibility. 我已经尝试了链接命名范围,但是我似乎失去了扩展性。 I have tried linking Table 1 to an Access database, then Linking that Access database with Table 2, but have not been able to get it to work. 我曾尝试将表1链接到Access数据库,然后将该Access数据库与表2链接,但无法使其正常工作。

Any thoughts? 有什么想法吗?

Cheers for any help. 为任何帮助加油。 R [R

If the Row Number of Table 1 in Excel Workbook 1 and Table 2 in the Excel Workbook 2 are the same, (Example, both tables begin at row number 5), then use the following formula 如果在Excel工作簿1中的Excel工作簿2 表1行号表2是相同的,(实施例,这两个表开始于行号5),则使用下面的公式

=IFERROR(IF(ISBLANK('Excel Workbook 1.xlsx'!Table1[[#This Row],[Col_A]]),"",'Excel Workbook 1.xlsx'!Table1[[#This Row],[Col_A]]),"") = IFERROR(IF(ISBLANK('Excel Workbook 1.xlsx'!Table1 [[#This Row],[Col_A]])),“”,''Excel Workbook 1.xlsx'!Table1 [[#This Row],[Col_A ]]), “”)

If the row numbers of Table 1 and Table 2 are different, (Example Table 1 begin at row 8 and Table 2 begins at Row 25) then use the below formula. 如果表1和表2的行号不同(示例表1从第8行开始,表2从第25行开始),则使用以下公式。

=IF(ISBLANK(OFFSET('Excel Workbook 1.xlsx'!Table1[#Data],ROW()-ROW(D$4)-1,0,1,1)),"",OFFSET('Excel Workbook 1.xlsx'!Table1[#Data],ROW()-ROW(D$4)-1,0,1,1)) = IF(ISBLANK(OFFSET('Excel Workbook 1.xlsx'!Table1 [#Data],ROW()-ROW(D $ 4)-1,0,1,1)),“”,OFFSET('Excel Workbook 1 .xlsx等表1 [#DATA],ROW() - ROW(d $ 4)-1,0,1,1))

In the 2nd formula, the D4 is the location of the title of the column of Table 2. 在第二个公式中,D4是表2列标题的位置。

In the 2nd Formula, I am assuming that there is no data below Table 1. All rows below the title of Table 1 should only contain data which is a part of Table 1. 在第二个公式中,我假设表1以下没有数据。表1标题下的所有行应仅包含表1的一部分的数据。

Change the Cell References, Workbook Names, Sheet Names and Table Names as required. 根据需要更改单元格引用,工作簿名称,工作表名称和表名称。

I hope this solves your problem. 我希望这能解决您的问题。

Regards, 问候,

Vijaykumar Shetye, Vijaykumar Shetye,

Spreadsheet Excellence, 电子表格卓越奖,

Panaji, Goa, India 印度果阿Panaji

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM