Leo Heuser said:
Assuming ChkNumLst contains the numbers 1,2,3,66000 (in e.g. D1
4),
I take it, that your formula is supposed to return the array
{4,5,6,,,,,65999}?
No, it should return {2,65537;3,65538;4,65539;...;65536,131071}.
If my assumption is correct, I would expect
=INDEX(MIN(ChkNumLst)+ROW(INDIRECT("1:"&MIN(MAX(ChkNumLst)
-MIN(ChkNumLst),65535)))+65535*(COLUMN(INDIRECT("RC1:RC"
&ROUNDUP((MAX(ChkNumLst)-MIN(ChkNumLst))/65535,0),0))-1),1)
to return 4, but it returns 2 !?
If you misunderstand how my expression works, don't be surprised that you
fail to anticipate what it returns.
How would you put the returned array into the worksheet?
....
Um, the normal way, but it's not supposed to be directly entered in a
worksheet. It's meant to be fed to SMALL. Note: you can select
R1C1:R65535C50 and enter the array formula
=ROW(INDIRECT("1:65535"))+65535*(COLUMN(INDIRECT("A:AX"))-1)
and it'll populate the range with sequential integers from 1 to 50*65535.
Can you not do this in Excel on your PC?
I tried to point out, that COUNTIF doesn't work on arrays.
OK, you're right. COUNTIF doesn't work with arrays. If the array in question
(smallarray) is sorted, however,
LOOKUP(bigarray,smallarray)=bigarray
is more efficient than ISNA(MATCH(bigarray,smallarray,0)).
I share your enthusiasm about the LOOKUP function. Too bad, that the
range has to be sorted, or to put it another way: it would be nice,
if VLOOKUP and HLOOKUP could take a vector as their first argument.
Well, it's an assumption, but the OP's array did appear sorted, and some
data processing experience would show that finding gaps in sequences is much
easier when the list is sorted. So for this sort of application, assuming
the list is sorted is a hint that the list should be sorted.
As for VLOOKUP and HLOOKUP, given the following table in A1:B20
A 3
D 5
E 53
G 77
G 87
H 15
L 12
L 12
L 62
M 36
O 58
O 75
P 83
R 31
S 41
T 57
U 4
V 35
Y 64
Z 15
the formula
=VLOOKUP({"A","E","I","O","U"},A1:B20,2)
if entered into a 5 column by 1 row range returns
3 53 15 75 4
And similarly for HLOOKUP. It's not that these functions can't take array
1st arguments, the problem is that they don't return arrays when fed such
1st arguments. They return something akin to what INDEX returns when fed
array 2nd or 3rd arguments.