Table:
0
A
B
C
D
1
document id
draft number
copy number
draft copies
2
2
8
5
3
4
9
6
4
23
9
15
5
10
20
10
6
2
1
4
7
1
2
5
8
20
17
15
9
12
12
10

Questions and formulas:
Question: How many draft copies does the document with id 2 have?
Formula: ROWS(UNIQUE(FILTER(D1, A1=2)))
Formula2: ROWS(UNIQUE(FILTER(D2:D9, A2:A9=2)))
Level: medium
Question: Which document has the most draft copies?
Formula: TAKE(SORT(SUMMARIZE(A1,DCOUNTX(D1)), 2, -1), 1)
Formula2: TAKE(SORT(SUMMARIZE(A2:A9,DCOUNTX(D2:D9)), 2, -1), 1)
Level: hard
Question: Which documents have more than 1 draft copies? List document id and number of draft copies.
Formula: LET(query1,SUMMARIZE(A1,DCOUNTX(D1)),FILTER(query1,CHOOSECOLS(query1,3)>1))
Formula2: LET(query1,SUMMARIZE(A2:A9,DCOUNTX(D2:D9)),FILTER(query1,CHOOSECOLS(query1,3)>1))
Level: hard