Table:
0
A
B
C
D
1
dorm id
dorm name
student capacity
gender
2
100
Smith Hall
85
X
3
110
Bud Jones Hall
116
M
4
140
Fawlty Towers
355
X
5
160
Dorm-plex 2000
400
X
6
109
Anonymous Donor Hall
128
F
7
117
University Hovels
40
X
8
104
Grad Student Asylum
256
X

Questions and formulas:
Question: Find the name of dorms only for female (F gender).
Formula: FILTER(B1,D1="F")
Formula2: FILTER(B2:B8,D2:D8="F")
Level: easy
Question: Find the name of dorms that can accommodate more than 300 students.
Formula: FILTER(B1,C1>300)
Formula2: FILTER(B2:B8,C2:C8>300)
Level: easy
Question: What are the names of all the dorms that can accomdate more than 300 students?
Formula: FILTER(B1,C1>300)
Formula2: FILTER(B2:B8,C2:C8>300)
Level: easy
Question: How many dorms are there?
Formula: SUM(A1)
Formula2: SUM(A2:A8)
Level: easy
Question: How many dorms are in the database?
Formula: SUM(A1)
Formula2: SUM(A2:A8)
Level: easy
Question: Find the total capacity of all dorms.
Formula: SUM(C1)
Formula2: SUM(C2:C8)
Level: easy
Question: What is the total student capacity of all dorms?
Formula: SUM(C1)
Formula2: SUM(C2:C8)
Level: easy
Question: Find the number of distinct gender for dorms.
Formula: ROWS(UNIQUE(D1))
Formula2: ROWS(UNIQUE(D2:D8))
Level: easy
Question: How many different genders are there in the dorms?
Formula: ROWS(UNIQUE(D1))
Formula2: ROWS(UNIQUE(D2:D8))
Level: easy
Question: Find the name of the dorm with the largest capacity.
Formula: LET(a,SORTBY(B1,C1,-1),FILTER(a,SEQUENCE(ROWS(a))<=1))
Formula2: LET(a,SORTBY(B2:B8,C2:C8,-1),FILTER(a,SEQUENCE(ROWS(a))<=1))
Level: hard
Question: What are the names of the dorm with the largest capacity?
Formula: LET(a,SORTBY(B1,C1,-1),FILTER(a,SEQUENCE(ROWS(a))<=1))
Formula2: LET(a,SORTBY(B2:B8,C2:C8,-1),FILTER(a,SEQUENCE(ROWS(a))<=1))
Level: hard
Question: Find the number of dorms and total capacity for each gender.
Formula: SUMMARIZE(D1,SUMX(A1),SUMX(C1))
Formula2: SUMMARIZE(D2:D8,SUMX(A2:A8),SUMX(C2:C8))
Level: medium
Question: How many dorms are there and what is the total capacity for each gender?
Formula: SUMMARIZE(D1,SUMX(A1),SUMX(C1))
Formula2: SUMMARIZE(D2:D8,SUMX(A2:A8),SUMX(C2:C8))
Level: medium
Question: The number of dorms.
Formula: SUM(A1)
Formula2: SUM(A2:A8)
Level: easy
Question: What is the number of dorms?
Formula: SUM(A1)
Formula2: SUM(A2:A8)
Level: easy
Question: Female students' dorm called?
Formula: UNIQUE(CHOOSECOLS(FILTER(A1:D1,D1="f"),2))
Formula2: UNIQUE(CHOOSECOLS(FILTER(A2:D8,D2:D8="f"),2))
Level: medium
Question: Names of dorms which are capable of accmmodating more than 300 students.
Formula: LET(query1,SUMMARIZE(B1,SUMX(C1)),FILTER(query1,CHOOSECOLS(query1,2)>300))
Formula2: LET(query1,SUMMARIZE(B2:B8,SUMX(C2:C8)),FILTER(query1,CHOOSECOLS(query1,2)>300))
Level: hard
Question: Names and ids for dorms holding more than 300 students.
Formula: LET(query1,SUMMARIZE(HSTACK(B1,A1),SUMX(C1)),FILTER(query1,CHOOSECOLS(query1,3)>300))
Formula2: LET(query1,SUMMARIZE(HSTACK(B2:B8,A2:A8),SUMX(C2:C8)),FILTER(query1,CHOOSECOLS(query1,3)>300))
Level: hard
Question: What is the name, id of the dorm that accommodates most students?
Formula: LET(a,HSTACK(B1,A1),b,A1,c,CHOOSECOLS(TAKE(SORT(SUMMARIZE(A1,SUMX(C1)), 2, -1), 1),1),UNIQUE(FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Formula2: LET(a,HSTACK(B2:B8,A2:A8),b,A2:A8,c,CHOOSECOLS(TAKE(SORT(SUMMARIZE(A2:A8,SUMX(C2:C8)), 2, -1), 1),1),UNIQUE(FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Level: hard
Question: The name and id of the dorm that can accommodate most students.
Formula: LET(a,HSTACK(B1,A1),b,A1,c,CHOOSECOLS(TAKE(SORT(SUMMARIZE(A1,SUMX(C1)), 2, -1), 1),1),UNIQUE(FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Formula2: LET(a,HSTACK(B2:B8,A2:A8),b,A2:A8,c,CHOOSECOLS(TAKE(SORT(SUMMARIZE(A2:A8,SUMX(C2:C8)), 2, -1), 1),1),UNIQUE(FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Level: hard
Question: What is the number of dorms and the total capacity of each gender?
Formula: SUMMARIZE(D1,SUMX(A1),SUMX(C1))
Formula2: SUMMARIZE(D2:D8,SUMX(A2:A8),SUMX(C2:C8))
Level: medium
Question: The number of dorms and total capacity of each gender.
Formula: SUMMARIZE(D1,SUMX(A1),SUMX(C1))
Formula2: SUMMARIZE(D2:D8,SUMX(A2:A8),SUMX(C2:C8))
Level: medium
Question: Names of dorms for female students
Formula: UNIQUE(CHOOSECOLS(FILTER(A1:D1,D1="f"),2))
Formula2: UNIQUE(CHOOSECOLS(FILTER(A2:D8,D2:D8="f"),2))
Level: medium