简体   繁体   English

在 Excel 中引用另一个单元格公式的公式

[英]Formula to Reference another Cell's Formula in Excel

I was teaching Vlookup to a coworker.我正在给同事教 Vlookup。 We were trying to copy last month's spreadsheet, rename it to include the date, then reference another spreadsheet that is also renamed to include the current date.我们试图复制上个月的电子表格,将其重命名为包含日期,然后引用另一个也已重命名为包含当前日期的电子表格。

Lets call the first spreadsheet Investor Statements and the second spreadsheet Value Per Investor.让我们将第一个电子表格称为“投资者报表”和第二个电子表格“每位投资者的价值”。 I copy Q3 2019 Investor Statements into a new folder and rename is Q4 2019 Investor Statements.我将 2019 年第三季度投资者报表复制到一个新文件夹中,并重命名为 2019 年第四季度投资者报表。 Each quarter must be saved for auditing purposes.每个季度都必须保存以供审计之用。 Then I copy the Q3 Value Per Investor into Q4 Value Per Invester.然后我将 Q3 每位投资者的价值复制到 Q4 每位投资者的价值中。 They are also saved into the Folder Q4 so that the file location is new.它们也被保存到文件夹 Q4 中,以便文件位置是新的。

The Investor Statements spreadsheet uses VLOOKUP to pull several values from the Value Per Investor spreadsheet. Investor Statements 电子表格使用 VLOOKUP 从 Value Per Investor 电子表格中提取多个值。 The problem is that since there is a new file location and a new file name, the VLOOKUP formula's range must be updated.问题在于,由于存在新文件位置和新文件名,因此必须更新 VLOOKUP 公式的范围。 There are roughly 50 investors so it is a pain to do copy and paste onto each page.大约有 50 名投资者,因此复制和粘贴到每个页面上很痛苦。
My first thought was to create a master Investor Statement spreadsheet and a master Value Per Investor spreadsheet.我的第一个想法是创建一个主投资者报表电子表格和一个主投资者价值电子表格。 Then I could update the info in the Value Per Investor spreadsheet and have it update the VLOOKUP in the Investor Statements.然后我可以更新每个投资者的价值电子表格中的信息,并让它更新投资者报表中的 VLOOKUP。 This did not work because the file location for the VLOOKUP in the Investor Statement will remain the same and still reference the Master Value Per Investor sheet.这不起作用,因为投资者声明中 VLOOKUP 的文件位置将保持不变,并且仍然引用每个投资者的主价值表。

I need a way to update the VLOOKUP in Investor Statement without updating all 50 tabs.我需要一种方法来更新投资者声明中的 VLOOKUP,而无需更新所有 50 个选项卡。 So my co-worker asked me why can't I just updated the first tab and have the other tabs reference that formula in that cell.所以我的同事问我为什么我不能只更新第一个选项卡并让其他选项卡在该单元格中引用该公式。 This is similar to how we update the date.这类似于我们更新日期的方式。 We put the date on the first tab and then on the second tab it is a link to that cell.我们将日期放在第一个选项卡上,然后在第二个选项卡上,它是指向该单元格的链接。 This only works with VALUES however and not with FORMULAS.但是,这只适用于 VALUES,不适用于 FORMULAS。

I have been thinking about this problem since yesterday and I am hoping someone has an ingenious way around copying and pasting 50 times.我从昨天开始就一直在思考这个问题,我希望有人能巧妙地复制和粘贴 50 次。

Thanks, Matt谢谢,马特

I am going to presume you don't want to go down a VBA route, and I am sure someone will maybe have a better answer but have you not thought about a simple Find and Replace (CTRL+F)?我假设你不想走 VBA 路线,我相信有人可能会有更好的答案,但你有没有想过一个简单的查找和替换(CTRL+F)?

Just replace the current file location with the new location, Find and Replace All.只需将当前文件位置替换为新位置,查找并全部替换。 It works within formulas.它适用于公式。

在此处输入图片说明

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

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