arrayrange(Array,FirstItem,LastItem,Separator)
works as expected in most situations, but when using negative indices to count from the end, if the number of elements requested is greater than the total number in the array, it returns the null string instead of the whole array as I would expect:
arrayrange("A",-2,-1,",") ==>
arrayrange("A,B,C",-4,-1,",") ==>
If there are at least as many elements as requested it works as expected:
arrayrange("A,B",-2,-1,",") ==> A,B
arrayrange("A,B,C",-2,-1,",") ==> B,C
arrayrange("A,B,C,D",-4,-1,",") ==> A,B,C,D
Starting from the beginning of the array instead of the end, it works as expected in all cases, as far as I can tell. If more elements are requested than supplied, the result is the whole array:
arrayrange("A",1,2,",") ==> A
arrayrange("A,B",1,2,",") ==> A,B
arrayrange("A,B,C",1,2,",") ==> A,B
arrayrange("A,B,C",1,4,",") ==> A,B,C
arrayrange("A,B,C,D",1,4,",") ==> A,B,C,D
I would have expected that asking for either the first x or last x elements should give the same result when the array has between 1 and x elements.