Forum Discussion
Auto Populate Win Sheet via Numbers in another worksheet
If you have access to LAMBDA, you could this:
=MAKEARRAY(100,COUNTIF(numbers,MODE(numbers)),LAMBDA(r,c,IF(c<=COUNTIF(numbers,r),"x","")))
This formula creates a 100x5 matrix. The number of columns can expand depending on how many times the MODE is counted in your numbers list.
This is a fun task. You will get some good options for this one!
A simple dynamic array solution will do here. Lambda and helpers get you into the Microsoft nested arrays error (their error I contend, not ours).
= LET(
count, COUNTIFS(Data, numbers),
n, MAX(count),
k, SEQUENCE(1,n),
wins, IF(k<=count,"X",""),
VSTACK(k,wins)
)
- Patrick2788Nov 09, 2022Silver Contributor
I seldom use MAKEARRAY, but this request seemed like a good opportunity to put it to use. If timed to the millisecond, it's undoubtedly the slowest of the solutions. EXPAND is another one but there's only so much one can do with that one.
- PeterBartholomew1Nov 10, 2022Silver Contributor
I agree, a whole new toolbox has been provided and there is every reason to build up experience of the use of new tools. Some problems will have natural solutions that form a 2D array of single-cell results. Others really do require Microsoft to sort the 'nested arrays' error. There are problems whereby I have been reduced to performing a computationally intensive calculation to return a 1D array, select one term, then recalculate the same array.