简体   繁体   English

Excel 2010将单元格值添加到外部引用

[英]Excel 2010 add a cell value to an external reference

I need to add the value in cell A1 to a formula in cell B1 that references an external spreadsheet. 我需要将单元格A1中的值添加到单元格B1中引用外部电子表格的公式中。 Column A lists workdays of the month (ie 09-19-2014, 09-22-2014, 09-23-2014, etc.). A列列出了当月的工作日(例如,09-19-2014、09-22-2014、09-23-2014等)。 Column B has the following formula which works as expected by calculating headcount based on location and pay type. B列具有以下公式,该公式可以通过根据位置和薪资类型计算员工人数来按预期工作。

=IFERROR(SUMPRODUCT(('C:\Shared\Labor\HC\[09-23-2014.xls]report'!$H$2:$H$500="Location - 12")*('C:\Shared\Labor\HC\[09-23-2014.xls]report'!$G$2:$G$500="Hourly")),NA())

What I need to accomplish is instead of specifically using 09-23-2014 I need it to pull the value from column A of that row. 我需要完成的是使用2014年9月23日而不是我专门从该行的A列中提取值。 I have tried using evaluate, concatenate, and "& A1 &", but these methods do not pull in the needed value from the external spreadsheet. 我尝试使用评估,连接和“&A1&”,但是这些方法没有从外部电子表格中提取所需的值。

There are hundreds of spreadsheets thus eliminating the possibility of them being opened when this spreadsheet is opened. 有数百个电子表格,因此消除了打开该电子表格时将其打开的可能性。 Does anyone have any ideas to make this work? 有谁有任何想法使这项工作吗?

In many years working with excel I never find a possibility to retrieve values from an excel which is not opened. 在与excel一起工作的许多年中,我从来没有发现从未打开的excel检索值的可能性。 What you can try is to make a VBA code where you open each file, update your values and then close the file. 您可以尝试在打开每个文件,更新值然后关闭文件的地方制作一个VBA代码。 Because it will be quite a lot of code I can't give you an example for this. 因为这将是很多代码,所以我无法为您提供示例。 You can make a list of all paths to the files and let VBA pass them one by one. 您可以列出文件的所有路径,然后让VBA逐个传递它们。

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

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