How to make the search range dynamic in a vlookup function

那年仲夏 提交于 2019-12-08 07:50:58

问题


I'm trying to make the vlookup function below 'dynamic' by substituting a portion of the sheet name with the value in a cell.

Current vlookup function

=VLOOKUP($B$4,studentA!A2:D,2)

Desired vlookup function uses the value in cell C4 to identify the student sheet

=VLOOKUP($B$4,studentC4A2:D,2)

Can someone please help me with the syntax for this?


回答1:


Use INDIRECT, e.g.

=VLOOKUP($B$4,INDIRECT("student"&C4&"!A2:D"),2)


来源:https://stackoverflow.com/questions/48694257/how-to-make-the-search-range-dynamic-in-a-vlookup-function

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