google sheets - INDIRECT function in an INDEX-MATCH-MATCH - Stack Overflow

I have a summary tab with column headers for each week with tabs that match the name exactly, but the c

I have a summary tab with column headers for each week with tabs that match the name exactly, but the column headers in the underlying tabs are not consistent.

The current formula manually calls those tab names:

=IFERROR(INDEX('17/09'!$C:$Y, MATCH($B4, '17/09'!$B:$B, 0), MATCH(G$3, '17/09'!$C$3:$Y$3, 0)),0)

I'm trying to update with the INDIRECT function and this formula works:

=INDEX(INDIRECT(CHAR(39)&TEXT(F$2,"DD/MM")&"'!$S:$S"), MATCH($B4, INDIRECT(CHAR(39)&TEXT(F$2,"DD/MM")&"'!$B:$B"), 0),0)

But when I try to patch in the 2nd MATCH it fails:

=INDEX(INDIRECT(CHAR(39)&TEXT(F$2,"DD/MM")&"'!$C:$Y"), MATCH($B4, INDIRECT(CHAR(39)&TEXT(F$2,"DD/MM")&"'!$B:$B"), 0), 
MATCH(F$3, INDIRECT(CHAR(39)&TEXT(F$2,"DD/MM")&"'!$C$3:$W$3", 0)),0)

Error Function INDIRECT parameter 1 value is ''10/09'!$C$3:$W$3'. It is not a valid cell/range reference.

Can you help?

I have a summary tab with column headers for each week with tabs that match the name exactly, but the column headers in the underlying tabs are not consistent.

The current formula manually calls those tab names:

=IFERROR(INDEX('17/09'!$C:$Y, MATCH($B4, '17/09'!$B:$B, 0), MATCH(G$3, '17/09'!$C$3:$Y$3, 0)),0)

I'm trying to update with the INDIRECT function and this formula works:

=INDEX(INDIRECT(CHAR(39)&TEXT(F$2,"DD/MM")&"'!$S:$S"), MATCH($B4, INDIRECT(CHAR(39)&TEXT(F$2,"DD/MM")&"'!$B:$B"), 0),0)

But when I try to patch in the 2nd MATCH it fails:

=INDEX(INDIRECT(CHAR(39)&TEXT(F$2,"DD/MM")&"'!$C:$Y"), MATCH($B4, INDIRECT(CHAR(39)&TEXT(F$2,"DD/MM")&"'!$B:$B"), 0), 
MATCH(F$3, INDIRECT(CHAR(39)&TEXT(F$2,"DD/MM")&"'!$C$3:$W$3", 0)),0)

Error Function INDIRECT parameter 1 value is ''10/09'!$C$3:$W$3'. It is not a valid cell/range reference.

Can you help?

Share Improve this question asked Nov 17, 2024 at 1:00 Justin CohenJustin Cohen 71 silver badge2 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

I removed the Excel tag since it's clearly not an Excel question (Excel does not allow the slash character in sheet names).

The issue you're encountering is because the INDIRECT function does not accept cell or range references that are formatted with the CHAR(39) single quotes..

Your formula fails because INDIRECT is not parsing CHAR(39) correctly when combined with TEXT and MATCH in the range string. Instead of using CHAR(39), concatenate the strings directly using single quotes like this:

=INDEX(INDIRECT("'" & TEXT(F$2,"DD/MM") & "'!$C:$Y"), 
       MATCH($B4, INDIRECT("'" & TEXT(F$2,"DD/MM") & "'!$B:$B"), 0), 
       MATCH(F$3, INDIRECT("'" & TEXT(F$2,"DD/MM") & "'!$C$3:$W$3"), 0))

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745640582a4637666.html

相关推荐

  • google sheets - INDIRECT function in an INDEX-MATCH-MATCH - Stack Overflow

    I have a summary tab with column headers for each week with tabs that match the name exactly, but the c

    6小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信