简体   繁体   English

获取当前处理数组的上述值(excel中公式执行时的结果数组)

[英]Getting the above value of the currently processed array (result array during formula execution in excel)

I know how to get a value from an above cell of a cell with a formula being executed but I am struggling to do the same with an array.我知道如何从正在执行公式的单元格的上方单元格中获取值,但我正在努力对数组执行相同的操作。 You can simply refer to the above cell and then let the drag function of excel do the magic for the other consequence cells.您可以简单地引用上面的单元格,然后让 excel 的拖动 function 为其他结果单元格施展魔法。

However, doing that with a dynamic array that has a single formula is new to me.但是,使用具有单个公式的动态数组来执行此操作对我来说是新的。 I want to be able to get the above (calculated) value of a result array (currently being executed by a formula).我希望能够获得结果数组的上述(计算)值(当前由公式执行)。

Take a look at the attached picture, you can see at C3 I failed to refer to the above row of the result array.看看附图,你可以看到在 C3 我没有引用结果数组的上面一行。 The expected column in E2 is what the result should be. E2 中的预期列是结果应该是什么。

示例数据和公式

I hope my question is clear...我希望我的问题很清楚...

Your help is highly appreciated非常感谢您的帮助

I don't think this particular case merits the use of a recursive set-up.我认为这种特殊情况不值得使用递归设置。 Simply:简单地:

=LOOKUP(ROW(B3#),ROW(B3#)/(LEFT(B3#,4)="Ref:"),RIGHT(B3#,2))

In any case, for the recursion you'd require a LAMBDA , for example:无论如何,对于递归,您需要一个LAMBDA ,例如:

=LAMBDA(δ,IF(δ<1,"",IF(LEFT(INDEX($B$3#,δ),4)="Ref:",RIGHT(INDEX($B$3#,δ),2),MyLambda(δ-1))))

stored in Name Manager as MyLambda , after which you can enter in the worksheet:在名称管理器中存储为MyLambda ,之后您可以在工作表中输入:

=MyLambda(ROWS($1:1))

and copy down as required.并按要求抄下来。

I'm certain this LAMBDA could be improved, even made to spill a dynamic array, though as I said, it's really not necessary here.我确信这个LAMBDA可以改进,甚至可以溢出动态数组,尽管正如我所说,这里真的没有必要。

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

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