Is it possible to have array as an argument to INDIRECT(), so INDIRECT() returns array? [closed]

巧了我就是萌 提交于 2020-02-15 07:57:38

问题


Suppose, that I have a vector of cells A1:A5, each with string that is an address of the other cell.

What I want to do, is to have a function, that returns an array of values from these referenced cells. See the example - I want the formula to return 15 (it returns 1).

In production setting, this vector is much longer (ca. 2000 rows).

What would solve the problem, is array-capable INDIRECT().

(I realize, that I might be pushing Excel beyond its the limits)...


My further thoughts on this topic:

Because the INDIRECT() is capable of producing arrays even from a single-cell input, such theoretical "INDIRECTARR()" formula would either require nested (i.e. multidimensional) array computation support in Excel, or will be intrinsically limited to arguments that denote one-dimensional ranges.


回答1:


Finally I've found a way to solve it. As long as the values are on one sheet, we can take advantage of the fact, that when the second and/or the third argument to INDEX is an array, the result is an array as well:

It is a bit hackish, but it certainly works and doesn't need any VBA nor addons. And it is fast.



来源:https://stackoverflow.com/questions/19787285/is-it-possible-to-have-array-as-an-argument-to-indirect-so-indirect-returns

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