简体   繁体   中英

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.

From here, I need to find the sum of the number of rows as defined in cell T2 - 24 rows. In this example, I need sum of 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))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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