如何使这个公式支持多行/拖动? [英] How do I make this formula support multiple rows/dragging?

查看:121
本文介绍了如何使这个公式支持多行/拖动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

继续此线程



公式到目前为止。匹配[n] =匹配条件,HEADER =标题条件等。
此公式将与特定条件匹配的标题单元格的值相加,即:6502,该公式可匹配标题/ 6502,然后取RETURNSUM的值,一个命名范围,并添加其他匹配。

  = SUMPRODUCT((RETURNSUM * 
MID(HEADER,2,4)= IF(LEN(Match5)= 4,Match5&,Match5&)))+(RETURNSUM *
(MID(HEADER,2,4)= IF LEN(Match6)= 4,Match6&,Match6&)))+(RETURNSUM *
(MID(HEADER,2,4)= IF(LEN(Match7)= 4,Match7& ,Match7&)))

想法是,HEADER和RETURNSUM将成为匹配标准,如这样一来,在搜索表中更容易打入新的标准。目前,即使在像$ A2:$ F2这样的单元格区域写入时也不支持多行/拖动。 / p>

我的问题是,我如何去做命名细胞多行capabl

解决方案

您可以使用 = INDEX(array,row_num,[col_num])来实现这一点。



索引公式只会从相应的行获取结果。 行(1:1)将在拖动时自动更新,以便 INDEX 可以抓住下一行。



= SUMPRODUCT((INDEX(RETURNSUM,ROW(1:1),0)*
(MID(HEADER,2,4)= IF(LEN(Match5)= 4,Match5&,Match5&))))+(INDEX(RETURNSUM,ROW(1:1),0)*
(MID(HEADER, = IF(LEN(Match6)= 4,Match6&,Match6&)))+(INDEX(RETURNSUM,ROW(1:1),0)*
(MID(HEADER, )= IF(LEN(Match7)= 4,Match7&,Match7&)))))


Continuation of this thread

Formula so far. Match[n] = match criteria, HEADER = header criteria etc. This formula Sums the values of the header cells that match a specific criteria, ie: 6502, with this formula, could match a header /6502, then take the value of RETURNSUM, a named range and add them with other matches.

    =SUMPRODUCT((RETURNSUM*
(MID(HEADER,2,4)=IF(LEN(Match5)=4,Match5&"",Match5&" ")))+(RETURNSUM*
(MID(HEADER,2,4)=IF(LEN(Match6)=4,Match6&"",Match6&" ")))+(RETURNSUM*
(MID(HEADER,2,4)=IF(LEN(Match7)=4,Match7&"",Match7&" ")))

The idea is that HEADER and RETURNSUM will become match criteria like the matches written above, that way it would be easier to punch new criterion into the search table. As of the moment, it doesn't support multiple rows/dragging even though it did when written as cell ranges like $A2:$F2.

The question I have is, how do I go about making the named cells multi-row capable?

解决方案

You can use =INDEX(array,row_num,[col_num]) to achieve this.

The index formula will only take results from the corresponding row. Row(1:1) will automatically update when dragged down so INDEX can then grab the next row.

=SUMPRODUCT((INDEX(RETURNSUM,ROW(1:1),0)* (MID(HEADER,2,4)=IF(LEN(Match5)=4,Match5&"",Match5&" ")))+(INDEX(RETURNSUM,ROW(1:1),0)* (MID(HEADER,2,4)=IF(LEN(Match6)=4,Match6&"",Match6&" ")))+(INDEX(RETURNSUM,ROW(1:1),0)* (MID(HEADER,2,4)=IF(LEN(Match7)=4,Match7&"",Match7&" "))))

这篇关于如何使这个公式支持多行/拖动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆