Table:
0
A
B
C
D
1
document id
location code
date in location from
date in locaton to
2
7
e
1/6/2017 23:17
6/8/2008 12:45
3
11
x
1/6/2017 23:17
7/3/2012 9:48
4
81
c
3/31/1972 9:47
11/5/1987 6:11
5
81
c
1/6/2017 23:17
11/26/2010 19:22
6
81
x
6/8/2008 12:45
6/15/1976 3:40
7
111
x
10/14/1986 17:53
11/26/2010 19:22
8
119
b
1/6/2017 23:17
1/1/1995 3:52
9
166
b
5/13/1985 12:19
10/14/1986 17:53
10
166
b
10/14/1986 17:53
11/26/2010 19:22
11
170
x
3/10/1997 15:24
6/15/1976 3:40
12
230
e
3/31/1972 9:47
11/5/1987 6:11
13
230
e
11/26/2010 19:22
1/6/2017 23:17
14
252
n
1/6/2017 23:17
3/10/1997 15:24
15
252
x
3/31/1972 9:47
8/18/2009 3:29
16
260
e
8/18/2009 3:29
10/14/1986 17:53

Questions and formulas:
Question: What are the different location codes for documents?
Formula: UNIQUE(B1)
Formula2: UNIQUE(B2:B16)
Level: easy
Question: Give me all the distinct location codes for documents.
Formula: UNIQUE(B1)
Formula2: UNIQUE(B2:B16)
Level: easy
Question: Show the location codes and the number of documents in each location.
Formula: SUMMARIZE(B1,SUMX(A1))
Formula2: SUMMARIZE(B2:B16,SUMX(A2:A16))
Level: easy
Question: What is the code of each location and the number of documents in that location?
Formula: SUMMARIZE(B1,SUMX(A1))
Formula2: SUMMARIZE(B2:B16,SUMX(A2:A16))
Level: easy
Question: What is the location code with the most documents?
Formula: TAKE(SORT(SUMMARIZE(B1,SUMX(A1)), 2, -1), 1)
Formula2: TAKE(SORT(SUMMARIZE(B2:B16,SUMX(A2:A16)), 2, -1), 1)
Level: hard
Question: Find the code of the location with the largest number of documents.
Formula: TAKE(SORT(SUMMARIZE(B1,SUMX(A1)), 2, -1), 1)
Formula2: TAKE(SORT(SUMMARIZE(B2:B16,SUMX(A2:A16)), 2, -1), 1)
Level: hard
Question: Show the location codes with at least 3 documents.
Formula: LET(query1,SUMMARIZE(B1,SUMX(A1)),FILTER(query1,CHOOSECOLS(query1,3)>=3))
Formula2: LET(query1,SUMMARIZE(B2:B16,SUMX(A2:A16)),FILTER(query1,CHOOSECOLS(query1,3)>=3))
Level: hard
Question: What are the codes of the locations with at least three documents?
Formula: LET(query1,SUMMARIZE(B1,SUMX(A1)),FILTER(query1,CHOOSECOLS(query1,3)>=3))
Formula2: LET(query1,SUMMARIZE(B2:B16,SUMX(A2:A16)),FILTER(query1,CHOOSECOLS(query1,3)>=3))
Level: hard