Table:
0
A
B
C
D
1
head id
name
born state
age
2
1
Tiger Woods
Alabama
67
3
2
Sergio García
California
68
4
3
K. J. Choi
Alabama
69
5
4
Dudley Hart
California
52
6
5
Jeff Maggert
Delaware
53
7
6
Billy Mayfair
California
69
8
7
Stewart Cink
Florida
50
9
8
Nick Faldo
California
56
10
9
Pádraig Harrington
Connecticut
43
11
10
Franklin Langham
Connecticut
67

Questions and formulas:
Question: How many heads of the departments are older than 56 ?
Formula: SUM(LET(a,A1,b,A1,c,INDEX(LET(query1,SUMMARIZE(A1,SUMX(D1)),FILTER(query1,CHOOSECOLS(query1,2)>56)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Formula2: SUM(LET(a,A2:A11,b,A2:A11,c,INDEX(LET(query1,SUMMARIZE(A2:A11,SUMX(D2:D11)),FILTER(query1,CHOOSECOLS(query1,2)>56)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Level: hard
Question: List the name, born state and age of the heads of departments ordered by age.
Formula: SORTBY(CHOOSE({1,2,3},B1,C1,D1),D1,1)
Formula2: SORTBY(CHOOSE({1,2,3},B2:B11,C2:C11,D2:D11),D2:D11,1)
Level: easy
Question: What are the names of the heads who are born outside the California state?
Formula: FILTER(B1,C1<>"California")
Formula2: FILTER(B2:B11,C2:C11<>"California")
Level: easy
Question: What are the names of the states where at least 3 heads were born?
Formula: LET(a,HSTACK(B1,C1),b,C1,c,CHOOSECOLS(LET(query1,SUMMARIZE(C1,SUMX(A1)),FILTER(query1,CHOOSECOLS(query1,3)>=3)),1),UNIQUE(FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Formula2: LET(a,HSTACK(B2:B11,C2:C11),b,C2:C11,c,CHOOSECOLS(LET(query1,SUMMARIZE(C2:C11,SUMX(A2:A11)),FILTER(query1,CHOOSECOLS(query1,3)>=3)),1),UNIQUE(FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Level: hard
Question: names and head ids from california
Formula: LET(query1,FILTER(A1:D1,C1="california"),UNIQUE(CHOOSECOLS(query1,2,1)))
Formula2: LET(query1,FILTER(A2:D11,C2:C11="california"),UNIQUE(CHOOSECOLS(query1,2,1)))
Level: hard
Question: States where at least 3 heads were born.
Formula: LET(query1,SUMMARIZE(C1,SUMX(A1)),FILTER(query1,CHOOSECOLS(query1,3)>=3))
Formula2: LET(query1,SUMMARIZE(C2:C11,SUMX(A2:A11)),FILTER(query1,CHOOSECOLS(query1,3)>=3))
Level: hard
Question: Number of department heads who are older than 56.
Formula: SUM(LET(a,A1,b,A1,c,INDEX(LET(query1,SUMMARIZE(A1,SUMX(D1)),FILTER(query1,CHOOSECOLS(query1,2)>56)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Formula2: SUM(LET(a,A2:A11,b,A2:A11,c,INDEX(LET(query1,SUMMARIZE(A2:A11,SUMX(D2:D11)),FILTER(query1,CHOOSECOLS(query1,2)>56)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Level: hard
Question: the names and head ids in california
Formula: LET(query1,FILTER(A1:D1,C1="california"),UNIQUE(CHOOSECOLS(query1,2,1)))
Formula2: LET(query1,FILTER(A2:D11,C2:C11="california"),UNIQUE(CHOOSECOLS(query1,2,1)))
Level: hard