简体   繁体   English

如何评估Google表格中的公式?

[英]How do I evaluate a formula in Google Sheets?

I'm trying to see where the math is going wrong in a formula, but I can't find a way to see what the formula is doing step by step. 我试图查看公式中的数学运算出了什么问题,但是我找不到一种方法来逐步了解公式在做什么。 In Excel, you can search in the help bar for a tool called 'evaluate formula' which does exactly the job I need but I cannot find a similar formula in Google Sheets 在Excel中,您可以在帮助栏中搜索名为“评估公式”的工具,该工具可以完成我所需的工作,但我无法在Google表格中找到类似的公式

Is there a way to evaluate a formula that is stored in a cell? 有没有一种方法可以计算存储在单元格中的公式? Immediately appears on a google search however this talks about taking a string in 1 cell and using it as a formula in another cell, which is not what I'm looking for. 立即出现在google搜索中,但是这涉及在1个单元格中获取字符串并在另一个单元格中将其用作公式,这不是我想要的。 I think in the 6 years since that post the phrase 'evaluate' has changed in meaning slightly. 我认为自该职位发布以来的6年中,“评估”一词的含义已略有变化。

=(IFERROR((vlookup($E9,$A$3:$Y$102,21,FALSE)*$J9),0))+(IFERROR((vlookup($F9,$A$3:$Y$102,21,FALSE)*$K9),0))+(IFERROR((vlookup($G9,$A$3:$Y$102,21,FALSE)*$L9),0))+(IFERROR((vlookup($H9,$A$3:$Y$102,21,FALSE)*$M9),0))+(IFERROR((vlookup($I9,$A$3:$Y$102,21,FALSE)*$N9),0))    

Easier to read if I put it like this: 如果我这样说,则更容易阅读:

 =(IFERROR((vlookup($E9,$A$3:$Y$102,21,FALSE)*$J9),0))+
(IFERROR((vlookup($F9,$A$3:$Y$102,21,FALSE)*$K9),0))+
(IFERROR((vlookup($G9,$A$3:$Y$102,21,FALSE)*$L9),0))+
(IFERROR((vlookup($H9,$A$3:$Y$102,21,FALSE)*$M9),0))+
(IFERROR((vlookup($I9,$A$3:$Y$102,21,FALSE)*$N9),0))    

I'd like to see what each vlookup is returning individually. 我想看看每个vlookup返回什么。 I have over 500 cells with V similar cells so making a cell for each vlookup , then referencing those cells so it's easier to track the results isn't practical. 我有500个以上的单元格,其中V个相似的单元格,因此为每个vlookup创建一个单元格,然后引用这些单元格,这样更容易跟踪结果不切实际。

I expect the output of this cell, C9, to be less than B9 and more than D9 (B9>C9>D9 ect) however I am seeing inconsistent results where sometimes this rule is followed and sometimes it is not in my spreadsheet. 我希望此单元格C9的输出小于B9且大于D9(B9> C9> D9 ect),但是我看到不一致的结果,有时遵循此规则,有时不在我的电子表格中。

well, the most obvious way is to run them separately like: 好吧,最明显的方法是分别运行它们,例如:

=IFERROR((VLOOKUP($E9, $A$3:$Y$102, 21, 0)*$J9), 0)

or in an array: 或数组中:

={IFERROR((VLOOKUP($E9, $A$3:$Y$102, 21, 0)*$J9), 0),
  IFERROR((VLOOKUP($F9, $A$3:$Y$102, 21, 0)*$K9), 0),
  IFERROR((VLOOKUP($G9, $A$3:$Y$102, 21, 0)*$L9), 0),
  IFERROR((VLOOKUP($H9, $A$3:$Y$102, 21, 0)*$M9), 0),
  IFERROR((VLOOKUP($I9, $A$3:$Y$102, 21, 0)*$N9), 0)}  

or column instead of row: 或列而不是行:

={IFERROR((VLOOKUP($E9, $A$3:$Y$102, 21, 0)*$J9), 0);
  IFERROR((VLOOKUP($F9, $A$3:$Y$102, 21, 0)*$K9), 0);
  IFERROR((VLOOKUP($G9, $A$3:$Y$102, 21, 0)*$L9), 0);
  IFERROR((VLOOKUP($H9, $A$3:$Y$102, 21, 0)*$M9), 0);
  IFERROR((VLOOKUP($I9, $A$3:$Y$102, 21, 0)*$N9), 0)}  

or in one cell perhaps: 或在一个单元格中:

=IFERROR((VLOOKUP($E9, $A$3:$Y$102, 21, 0)*$J9), 0)&" "&
 IFERROR((VLOOKUP($F9, $A$3:$Y$102, 21, 0)*$K9), 0)&" "&
 IFERROR((VLOOKUP($G9, $A$3:$Y$102, 21, 0)*$L9), 0)&" "&
 IFERROR((VLOOKUP($H9, $A$3:$Y$102, 21, 0)*$M9), 0)&" "&
 IFERROR((VLOOKUP($I9, $A$3:$Y$102, 21, 0)*$N9), 0)

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

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