Table:
0
A
B
C
D
E
1
district id
district name
headquartered city
city population
city area
2
1
Attock District
Attock City
94620
20
3
2
Bahawalnagar District
Bahawalnagar City
134936
13
4
3
Bahawalpur District
Bahawalpur City
530438
38
5
4
Bhakkar District
Bhakkar City
89380
15
6
5
Chakwal District
Chakwal City
113524
10
7
6
Chiniot District
Chiniot City
219254
12
8
7
Dera Ghazi Khan District
Dera Ghazi Khan City
464742
22
9
8
Faisalabad District
Faisalabad City
2793721
147
10
9
Gujranwala District
Gujranwala City
1526168
75
11
10
Gujrat District
Gujrat City
328512
25
12
11
Hafizabad District
Hafizabad City
165936
10
13
12
Jhang District
Jhang City
365198
28
14
13
Jhelum District
Jhelum City
172073
22
15
14
Kasur District
Kasur City
314617
18
16
15
Khanewal District
Khanewal City
165038
17

Questions and formulas:
Question: Find all the distinct district names ordered by city area in descending.
Formula: UNIQUE(SORTBY(B1,E1,-1))
Formula2: UNIQUE(SORTBY(B2:B16,E2:E16,-1))
Level: easy
Question: What are the different district names in order of descending city area?
Formula: UNIQUE(SORTBY(B1,E1,-1))
Formula2: UNIQUE(SORTBY(B2:B16,E2:E16,-1))
Level: easy
Question: Find the name and population of district with population between 200000 and 2000000
Formula: CHOOSE({1,2},FILTER(B1,(D1>=200000)*(D1<=2000000)),FILTER(D1,(D1>=200000)*(D1<=2000000)))
Formula2: CHOOSE({1,2},FILTER(B2:B16,(D2:D16>=200000)*(D2:D16<=2000000)),FILTER(D2:D16,(D2:D16>=200000)*(D2:D16<=2000000)))
Level: medium
Question: What are the district names and city populations for all districts that between 200,000 and 2,000,000 residents?
Formula: CHOOSE({1,2},FILTER(B1,(D1>=200000)*(D1<=2000000)),FILTER(D1,(D1>=200000)*(D1<=2000000)))
Formula2: CHOOSE({1,2},FILTER(B2:B16,(D2:D16>=200000)*(D2:D16<=2000000)),FILTER(D2:D16,(D2:D16>=200000)*(D2:D16<=2000000)))
Level: medium
Question: Find the name all districts with city area greater than 10 or population larger than 100000
Formula: FILTER(B1,(E1>10)+(D1>100000))
Formula2: FILTER(B2:B16,(E2:E16>10)+(D2:D16>100000))
Level: easy
Question: Which district has the largest population?
Formula: LET(a,SORTBY(B1,D1,-1),FILTER(a,SEQUENCE(ROWS(a))<=1))
Formula2: LET(a,SORTBY(B2:B16,D2:D16,-1),FILTER(a,SEQUENCE(ROWS(a))<=1))
Level: hard
Question: Which district has the least area?
Formula: LET(a,SORTBY(B1,E1,1),FILTER(a,SEQUENCE(ROWS(a))<=1))
Formula2: LET(a,SORTBY(B2:B16,E2:E16,1),FILTER(a,SEQUENCE(ROWS(a))<=1))
Level: hard
Question: What is the name of the district with the smallest area?
Formula: LET(a,SORTBY(B1,E1,1),FILTER(a,SEQUENCE(ROWS(a))<=1))
Formula2: LET(a,SORTBY(B2:B16,E2:E16,1),FILTER(a,SEQUENCE(ROWS(a))<=1))
Level: hard
Question: Find the total population of the top 3 districts with the largest area.
Formula: LET(a,SORTBY(SUM(D1),E1,-1),FILTER(a,SEQUENCE(ROWS(a))<=3))
Formula2: LET(a,SORTBY(SUM(D2:D16),E2:E16,-1),FILTER(a,SEQUENCE(ROWS(a))<=3))
Level: hard
Question: the name and id of the district with area above 10 and population over 100000.
Formula: LET(query1,SUMMARIZE(HSTACK(B1,A1),SUMX(E1),SUMX(D1)),FILTER(query1,(CHOOSECOLS(query1,3)>10)*(CHOOSECOLS(query1,4)>100000)))
Formula2: LET(query1,SUMMARIZE(HSTACK(B2:B16,A2:A16),SUMX(E2:E16),SUMX(D2:D16)),FILTER(query1,(CHOOSECOLS(query1,3)>10)*(CHOOSECOLS(query1,4)>100000)))
Level: hard
Question: the district id with the largest city population
Formula: TAKE(SORT(SUMMARIZE(A1,SUMX(D1)), 2, -1), 1)
Formula2: TAKE(SORT(SUMMARIZE(A2:A16,SUMX(D2:D16)), 2, -1), 1)
Level: hard
Question: the district id with the smallest city area.
Formula: TAKE(SORT(SUMMARIZE(A1,SUMX(E1)), 2, 1), 1)
Formula2: TAKE(SORT(SUMMARIZE(A2:A16,SUMX(E2:E16)), 2, 1), 1)
Level: hard
Question: smallest city area's district name and id
Formula: TAKE(SORT(SUMMARIZE(HSTACK(A1,B1),SUMX(E1)), 3, 1), 1)
Formula2: TAKE(SORT(SUMMARIZE(HSTACK(A2:A16,B2:B16),SUMX(E2:E16)), 3, 1), 1)
Level: hard
Question: the id and name of district with the smallest city area
Formula: TAKE(SORT(SUMMARIZE(HSTACK(A1,B1),SUMX(E1)), 3, 1), 1)
Formula2: TAKE(SORT(SUMMARIZE(HSTACK(A2:A16,B2:B16),SUMX(E2:E16)), 3, 1), 1)
Level: hard