简体   繁体   中英

How to use INDIRECT with INDEX-MATCH in EXCEL

The formula

=INDEX(tblWeek1[Area],MATCH($P6,tblWeek1[Leader],0))

is working correctly where $P6 is a leader name and an Area for that leader is returned.

However, I want to replace the table names with the value from a cell that will contain a chosen table name (I have multiple table for different weeks). But,

=INDEX(INDIRECT("A1"&"[Area]"),MATCH($P6,(INDIRECT("A1")&"[Leader]"),0))

Does not work where A1 contains "tblWeek1" , even though =INDIRECT("A1")&"[Area]" by itself correctly returns: "tblWeek1[Area]"

Thoughts?

Thanks.

Try following formula.

=INDEX(INDIRECT(A1 & "[Area]"),MATCH(G3,INDIRECT(A1 & "[Leader]"),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