Index/Match multiple results in multiple sheets

亡梦爱人 提交于 2020-01-24 13:38:49

问题


As the title suggests I'm looking to do an Index/Match in multiples sheets but to also return multiple results.

I know how to return multiple results with

=IFERROR(INDEX(Sheet1!B$1:B$100,SMALL(IF(Sheet1!$A$1:$A$100=myValue,ROW(Sheet!$A$1:$A$100)),ROWS(1:1))),"")

and then copy it down.

I also know how to look through multiple sheets for a unique value

=IFERROR(INDEX(Sheet1!B$1:B$100,MATCH(myValue,Sheet1!$A$1:$A$100,0)),INDEX(Sheet2!B$1:B$100,MATCH(myValue,Sheet2!$A$1:$A$100,0)))

I was wondering if there was a way to do this with multiple values in multiple sheets ? Combining the two formulas in some way ?

My problem is that because I do not know when the switch between the two sheets will be made in the search, I cannot offset it by the correct number of rows in the first formula.

Thanks to all of you !


回答1:


Thanks Jeeped, it was exactly that ! Just needed to count the matched in the other sheets to reset the rows.

The final formula looks like this

=IFERROR(IFERROR(INDEX(Sheet1!B$1:B$100,SMALL(IF(Sheet1!$A$1:$A$100=myValue,ROW(Sheet!$A$1:$A$100)),ROWS(1:1))),INDEX(Sheet2!B$1:B$100,SMALL(IF(Sheet2!$A$1:$A$100=myValue,ROW(Sheet!$A$1:$A$100)),ROWS(1:1)-COUNTIF(Sheet1!$A$1:$A$100,myValue))),"")


来源:https://stackoverflow.com/questions/45462294/index-match-multiple-results-in-multiple-sheets

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!