How to use Lambda so the if statement is it's own test condition without rewriting if statement in google sheets

huangapple go评论65阅读模式
英文:

How to use Lambda so the if statement is it's own test condition without rewriting if statement in google sheets

问题

这是一个一般性问题,不基于具体的公式 - 但我无法在任何地方找到答案 - 但似乎应该是可能的。
在这个截图中,为了举例,您、Y 和 X 是相同的(有细微差异,但为了举例而言 - 让我们假设它们相同)。
How to use Lambda so the if statement is it's own test condition without rewriting if statement in google sheets

在公式中,相同的公式用于 if 语句,以确定我们是否应该继续实际计算公式。是否有一种方法可以使用 Lambda 来避免重复公式?

英文:

This is a general question based not on specific formula - but I couldn't find an answer to it anywhere - but it seems like it should be possible.
In this screenshot, you, Y and X are the same for the sake of example (there is a slight difference, but for example's sake - let's assume it's the same).
How to use Lambda so the if statement is it's own test condition without rewriting if statement in google sheets

In the formula, the same formula is used in an if statement to determine if we should move forward with actually calculating the formula. Is there a way to use lambda not to repeat the formula?

答案1

得分: 1

=lambda(X,if(X>0,X,0))(FORMULA)

英文:

yes you may condense it to something in the sorts of:

=lambda(X,if(X>0,X,0))(*FORMULA*)

a generalized example in the screenshot:

How to use Lambda so the if statement is it's own test condition without rewriting if statement in google sheets

huangapple
  • 本文由 发表于 2023年2月14日 02:24:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/75439852.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定