Last active
June 15, 2023 09:40
-
-
Save ncalm/25b871891583802739484bd3c39f65d4 to your computer and use it in GitHub Desktop.
This Excel lambda function creates a simple frequency table for a single-column array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
FREQ.SIMPLE | |
Calculates a simple frequency table of the values in a column | |
Inputs: | |
1. data - a single column of data | |
*/ | |
FREQ.SIMPLE = LAMBDA(data, | |
LET( | |
d, INDEX(data,,1), | |
u, UNIQUE(d), | |
X, N(u = TRANSPOSE(d)), | |
Y, SEQUENCE(ROWS(d), 1, 1, 0), | |
mp, MMULT(X,Y), | |
c, CHOOSE({1,2}, u, mp), | |
SORT(c, 2, -1) | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment