简体   繁体   English

Excel:基于查找范围的总和

[英]Excel: Sum of Range Based on Lookup

I need to find the sum of a range with a specified number of rows based on multi-criteria lookup. 我需要基于多条件查找来找到具有指定行数的范围的总和。

INDEX(A1:P241,MATCH(($S$2*12),$A$1:$A$241,0),MATCH($U$2,$A$1:$P$1,0)) 

The above formula is where I define my criteria - basically returns the value of the "starting point." 上面的公式是我定义标准的地方-基本上返回“起点”的值。 Let's say the cell reference is P13. 假设单元格引用为P13。

From here, I need to find the sum of the number of rows as defined in cell T2 - 24 rows. 从这里,我需要找到单元格T2中定义的行数的总和-24行。 In this example, I need sum of P14:P37 在此示例中,我需要P14:P37的总和

Data layout: 数据布局:

A1:P241 is my lookup table
S2 first condition - lookup corresponds to column A
U2 second condition- lookup corresponds to row 1
T2 number of rows that need to be summed 

OFFSET将工作:

=SUM(OFFSET(INDEX(A1:P241,MATCH($S$1*12,$A$1:$A$241,0),MATCH($U$1,$A$1:$P$1,0)),1,0,$T$1))

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

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