简体   繁体   中英

Excel: How to find the row dynamically with an Index Match formula

There are two tables:

  1. Holds the actual values
  2. Holds the ranking of the values by column in the first table

Please see the image below for an example:

在此处输入图片说明

As shown in the picture above, I want to find the row in the ranking table on the right that has a value of 3 , in the column Tone_Rank .

I'd then like to use that row to find the actually value corresponding to that row for the column starting with the same name on the table to the right. Here is what I have so far:

=INDEX(B2:E6,MATCH(???),MATCH(M4,G1:J1,0))

跳过排名表:

=SMALL(INDEX($B$2:$E$6,0,MATCH(LEFT(M4,FIND("_",M4)-1),$B$1:$E$1,0)),M2)

How about the following: =INDEX($B$1:$E$6,MATCH($M$2,INDEX($G1:$J6,,MATCH($M$4,$G$1:$J$1,0)),0),MATCH($M$4,$G$1:$J$1,0))

An extra index match is needed to get the correct column for searching the row number of your value.

You could even do this all at once without the _Rank helper table: =INDEX($A$1:$E$6,MATCH(LARGE(INDEX($A$1:$E$6,,MATCH($M$4,$A$1:$E$1,0)),$M$2),INDEX($A$1:$E$6,,MATCH($M$4,$A$1:$E$1,0)),0),MATCH($M$4,$A$1:$E$1,0)) Note that the value in M4 then needs to be "Tone" not "Tone_Rank"

I hope this helps (and yes, you can switch from large to small for flipping the ranking (high-low vs. Low-high).

Lol, I overlooked scott already posted a better version of this

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