如何在Google电子表格中编写公式,该公式将使用Vlookup函数计算乘以乘以的总和

发布于 2025-02-14 01:33:41 字数 1121 浏览 1 评论 0原文

我创建了一个电子表格来跟踪我的加密产品组合。

这是我要解决的任务的简单视图:

”带有描述的电子表格示例

想:

  1. 我 每个单元格(a3:c3)的数字(金额)
  2. 以与a3:c3 vlookup中的数字相关的货币名称(A2:c2),
  3. 每个货币的数据(F2:F4)和“*”金额(A3:A3: C3)和当前的价格(G2:G4)因此,
  4. 最后一步是总和所有乘以乘以并返回总和,

因此,如果我在原始工作表中使用这样的公式,则基本上对我有用:

=(O8*(VLOOKUP(O$1,AD$2:AE,2,FALSE)))+(P8*(VLOOKUP(P$1,AD$2:AE,2,FALSE)))+(Q8*(VLOOKUP(Q$1,AD$2:AE,2,FALSE)))+(R8*(VLOOKUP(R$1,AD$2:AE,2,FALSE)))+(S8*(VLOOKUP(S$1,AD$2:AE,2,FALSE)))+(T8*(VLOOKUP(T$1,AD$2:AE,2,FALSE)))+(U8/(VLOOKUP(U$1,AF$2:AG,2,FALSE)))+(W8*(VLOOKUP(W$1,AD$2:AE,2,FALSE)))+(X8*(VLOOKUP(X$1,AD$2:AE,2,FALSE)))+(Y8*(VLOOKUP(Y$1,AD$2:AE,2,FALSE)))

但是,此太长了,我想找到一种更好的方法来执行此功能,

当前公式的问题是,如果我在a:c之间添加新的钱包/货币(根据示例屏幕截图),则整个公式将中断因为它不会包括新值。这就是为什么我正在寻找一个更好的公式来插入a:c(因此变为a:d)之间的新列,总和在某种程度上起作用= sum = sum(a:d),

不管是多少我在a:d之间插入的单元格,如果我使用上述长函数,则最终功能将起作用

,一旦添加新列,我就必须重写许多其他单元格才能包含一个新的列函数。

如果您有任何疑问,请告诉我。

I have created a spreadsheet to track my crypto portfolio.

Here is the simple view of the task, that I'm trying to solve:

spreadsheet sample with the description

I want to:

  1. Take the number (amount) from each cell (A3:C3)
  2. Take the Currency name (A2:C2) that is related to the number in A3:C3
  3. VLOOKUP the data for EACH currency (F2:F4) and "*" amount (A3:C3) and the current price (G2:G4) accordingly
  4. The final step is to Sum all multiplied values and return the TOTAL SUM

So, basically, it works for me if I use the formula like that in my original sheet:

=(O8*(VLOOKUP(O$1,AD$2:AE,2,FALSE)))+(P8*(VLOOKUP(P$1,AD$2:AE,2,FALSE)))+(Q8*(VLOOKUP(Q$1,AD$2:AE,2,FALSE)))+(R8*(VLOOKUP(R$1,AD$2:AE,2,FALSE)))+(S8*(VLOOKUP(S$1,AD$2:AE,2,FALSE)))+(T8*(VLOOKUP(T$1,AD$2:AE,2,FALSE)))+(U8/(VLOOKUP(U$1,AF$2:AG,2,FALSE)))+(W8*(VLOOKUP(W$1,AD$2:AE,2,FALSE)))+(X8*(VLOOKUP(X$1,AD$2:AE,2,FALSE)))+(Y8*(VLOOKUP(Y$1,AD$2:AE,2,FALSE)))

However, this is too long and I'd like to find a better way to do this function

The problem with the current formula is that if I add a new wallet/currency between A:C (according to the sample screenshot), the whole formula will break because it won't include a new value. That's why I'm looking for a better formula to be able to insert the new column between A:C (so it becomes A:D) and the total SUM works in a way =sum(A:D)

No matter, how many cells I insert between A:D, the final function will work

If I use the long function like above, I have to rewrite many other cells to include a new column function once I add a new column.

Please let me know if you have any questions.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

安稳善良 2025-02-21 01:33:41

尝试:

=SUMPRODUCT(QUERY({TRANSPOSE(A3:C4), 
 IFNA(VLOOKUP(FLATTEN(A3:C3), F:G, 2, ))}, 
 "select Col2*Col3"))


=ARRAYFORMULA(MMULT(IF(B6:G10="", 0, B6:G10*HLOOKUP(B4:G4, 
 TRANSPOSE(J2:K10), 2, 0)), SEQUENCE(COLUMNS(B6:G10), 1, 1, 0)))

try:

=SUMPRODUCT(QUERY({TRANSPOSE(A3:C4), 
 IFNA(VLOOKUP(FLATTEN(A3:C3), F:G, 2, ))}, 
 "select Col2*Col3"))

enter image description here


=ARRAYFORMULA(MMULT(IF(B6:G10="", 0, B6:G10*HLOOKUP(B4:G4, 
 TRANSPOSE(J2:K10), 2, 0)), SEQUENCE(COLUMNS(B6:G10), 1, 1, 0)))

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文