Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
395 views
in Technique[技术] by (71.8m points)

Excel Formula INDEX MATCH with 2 criteria

I'm trying to get the specific population for a country in a certain year. $B4 is a specific country while in an external spreadsheet's column A, hence '[World Population.xlsx]Sheet1'!$A:$A contains the name $B4. For row 2, it has the years. Excel is telling me #N/A. I'm not sure what did I do wrong with the formula?

=INDEX('[World Population.xlsx]Sheet1'!$A$3:$BX$291,MATCH($B4,'[World Population.xlsx]Sheet1'!$A:$A,0),MATCH("1999", '[World Population.xlsx]Sheet1'!$2:$2),0)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You have the penultimate bracket in the wrong place, and you should line your ranges up:

=INDEX('[World Population.xlsx]Sheet1'!$B$3:$BX$291,MATCH($B4,'[World Population.xlsx]Sheet1'!$A$3:$A$291,0),MATCH("1999", '[World Population.xlsx]Sheet1'!$B$2:$BX$2,0))

or if the year is stored as a number, use:

=INDEX('[World Population.xlsx]Sheet1'!$B$3:$BX$291,MATCH($B4,'[World Population.xlsx]Sheet1'!$A$3:$A$291,0),MATCH(1999, '[World Population.xlsx]Sheet1'!$B$2:$BX$2,0))

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...