简体   繁体   中英

Get max value column from looked up row/range

After many unsuccessful tries I need your help with a formula.

I am trying to get the max value in a range of cells that should be looked up somehow.

I have a sales table for each item number which contains the amount of sales in each of four contries

    SE   DK  FI  NO
#1  10%  20% 70% 0%
#2  20%  20% 50% 10%

So, this table is called "Salessplit".

In another sheet I have rows with item numbers where I would like to return the highest selling country for that item.

#1 Look up #1 from Salessplit and return "FI"(that has the highest sales)
#2 Look up #2 from Salessplit and return "FI" here as well

Any idea how to manage this?

假设您的表位于Sheet1!A1:E10,第1行中包含标题,A列中的项目编号则在sheet2中尝试此公式!B2假设项目编号在Sheet2中!A2

=INDEX(Sheet1!B$1:E$1,MATCH(MAX(INDEX(Sheet1!B$2:E$10,MATCH(A2,Sheet1!A$2:A$10,0),0)),INDEX(Sheet1!B$2:E$10,MATCH(A2,Sheet1!A$2:A$10,0),0),0))

使用相同的假设,但采用略有不同的方法,使用偏移而不是几个索引。

=INDEX(Sheet1!A1:E1,,MATCH(MAX(OFFSET(Sheet1!A1:E1,MATCH(Sheet1!A2,Sheet1!A:A,0),0,1,)),OFFSET(Sheet1!A1:E1,MATCH(Sheet1!A2,Sheet1!A:A,0),0,1,),0))

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