Suppose I have a UDF MyFunc()
which is too costly to call more than once, MyFunc()
returns an array. By default, if applied to a single cell then the first value in the arr开发者_StackOverflow社区ay is used. I want the last value of the array.
So, is it possible to:
(a) reverse the array so that the last value is used, or
(b) just grab the last value directly?
You can use INDEX to return a certain position
If you know the position you want you could use
=INDEX(Myfunct(),2)
for the second position etc
For the last position of unknown size
=INDEX(Myfunct(),COUNTA(Myfunct()))
second last
=INDEX(Myfunct(),COUNTA(Myfunct())-1)
精彩评论