Table:
0
A
B
C
D
E
F
G
H
I
1
cars id
mpg
cylinders
edispl
horsepower
weight
accelerate
year
cars data
2
1
100
4
test
256
4096
90
2017
3
2
150
8
test
243
5078
70
1974
4
3
180
8
test
232
4091
60
1974
5
4
133
4
test
219
4760
45
1980
6
5
127
4
test
270
5374
72
1980
7
6
164
8
test
228
4123
89
1980
8
7
117
4
test
213
3986
71
1974

Questions and formulas:
Question: What is the number of the cars with horsepower more than 150?
Formula: SUM(LET(a,A1,b,A1,c,INDEX(LET(query1,SUMMARIZE(A1,SUMX(E1)),FILTER(query1,CHOOSECOLS(query1,2)>150)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Formula2: SUM(LET(a,A2:A8,b,A2:A8,c,INDEX(LET(query1,SUMMARIZE(A2:A8,SUMX(E2:E8)),FILTER(query1,CHOOSECOLS(query1,2)>150)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Level: hard
Question: What is the number of cars with a horsepower greater than 150?
Formula: SUM(LET(a,A1,b,A1,c,INDEX(LET(query1,SUMMARIZE(A1,SUMX(E1)),FILTER(query1,CHOOSECOLS(query1,2)>150)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Formula2: SUM(LET(a,A2:A8,b,A2:A8,c,INDEX(LET(query1,SUMMARIZE(A2:A8,SUMX(E2:E8)),FILTER(query1,CHOOSECOLS(query1,2)>150)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Level: hard
Question: What is the average weight of cars each year?
Formula: SUMMARIZE(HSTACK(A1,H1),AVERAGEX(F1))
Formula2: SUMMARIZE(HSTACK(A2:A8,H2:H8),AVERAGEX(F2:F8))
Level: medium
Question: What is the average weight and year for each year?
Formula: SUMMARIZE(H1,AVERAGEX(F1))
Formula2: SUMMARIZE(H2:H8,AVERAGEX(F2:F8))
Level: easy
Question: What is the average horsepower of the cars before 1980?
Formula: AVERAGE(FILTER(E1,H1<1980))
Formula2: AVERAGE(FILTER(E2:E8,H2:H8<1980))
Level: easy
Question: What is the average horsepower for all cards produced before 1980?
Formula: LET(query1,FILTER(A1:I1,Year(H1)<1980),SUMMARIZE(CHOOSECOLS(query1,1),AVERAGEX(CHOOSECOLS(query1,5))))
Formula2: LET(query1,FILTER(A2:I8,Year(H1)<1980),SUMMARIZE(CHOOSECOLS(query1,1),AVERAGEX(CHOOSECOLS(query1,5))))
Level: hard
Question: How many cars have more than 4 cylinders?
Formula: SUM(LET(a,A1,b,A1,c,INDEX(LET(query1,SUMMARIZE(A1,SUMX(C1)),FILTER(query1,CHOOSECOLS(query1,2)>4)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Formula2: SUM(LET(a,A2:A8,b,A2:A8,c,INDEX(LET(query1,SUMMARIZE(A2:A8,SUMX(C2:C8)),FILTER(query1,CHOOSECOLS(query1,2)>4)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Level: hard
Question: What is the number of cars with more than 4 cylinders?
Formula: SUM(LET(a,A1,b,A1,c,INDEX(LET(query1,SUMMARIZE(A1,SUMX(C1)),FILTER(query1,CHOOSECOLS(query1,2)>4)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Formula2: SUM(LET(a,A2:A8,b,A2:A8,c,INDEX(LET(query1,SUMMARIZE(A2:A8,SUMX(C2:C8)),FILTER(query1,CHOOSECOLS(query1,2)>4)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Level: hard
Question: In which years cars were produced weighing no less than 3000 and no more than 4000?
Formula: LET(query1,SUMMARIZE(HSTACK(H1,A1),SUMX(F1)),FILTER(query1,(CHOOSECOLS(query1,3)>=3000)*(CHOOSECOLS(query1,3)<=4000)))
Formula2: LET(query1,SUMMARIZE(HSTACK(H2:H8,A2:A8),SUMX(F2:F8)),FILTER(query1,(CHOOSECOLS(query1,3)>=3000)*(CHOOSECOLS(query1,3)<=4000)))
Level: hard
Question: What are the different years in which there were cars produced that weighed less than 4000 and also cars that weighted more than 3000?
Formula: LET(a,HSTACK(H1,A1),b,A1,c,CHOOSECOLS(LET(query1,SUMMARIZE(A1,SUMX(F1)),FILTER(query1,(CHOOSECOLS(query1,2)>3000)*(CHOOSECOLS(query1,2)<4000))),1),UNIQUE(FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Formula2: LET(a,HSTACK(H2:H8,A2:A8),b,A2:A8,c,CHOOSECOLS(LET(query1,SUMMARIZE(A2:A8,SUMX(F2:F8)),FILTER(query1,(CHOOSECOLS(query1,2)>3000)*(CHOOSECOLS(query1,2)<4000))),1),UNIQUE(FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Level: hard
Question: What is the horsepower of the car with the largest accelerate?
Formula: LET(a,SORTBY(E1,G1,-1),FILTER(a,SEQUENCE(ROWS(a))<=1))
Formula2: LET(a,SORTBY(E2:E8,G2:G8,-1),FILTER(a,SEQUENCE(ROWS(a))<=1))
Level: hard
Question: What is the horsepower of the car with the greatest accelerate?
Formula: LET(a,SORTBY(E1,G1,-1),FILTER(a,SEQUENCE(ROWS(a))<=1))
Formula2: LET(a,SORTBY(E2:E8,G2:G8,-1),FILTER(a,SEQUENCE(ROWS(a))<=1))
Level: hard
Question: How many cars has over 6 cylinders?
Formula: SUM(LET(a,A1,b,A1,c,INDEX(LET(query1,SUMMARIZE(A1,SUMX(C1)),FILTER(query1,CHOOSECOLS(query1,2)>6)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Formula2: SUM(LET(a,A2:A8,b,A2:A8,c,INDEX(LET(query1,SUMMARIZE(A2:A8,SUMX(C2:C8)),FILTER(query1,CHOOSECOLS(query1,2)>6)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Level: hard
Question: Number of cars with more than 150 horsepower.
Formula: SUM(LET(a,A1,b,A1,c,INDEX(LET(query1,SUMMARIZE(A1,SUMX(E1)),FILTER(query1,CHOOSECOLS(query1,2)>150)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Formula2: SUM(LET(a,A2:A8,b,A2:A8,c,INDEX(LET(query1,SUMMARIZE(A2:A8,SUMX(E2:E8)),FILTER(query1,CHOOSECOLS(query1,2)>150)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Level: hard
Question: Number of cars which have horsepower exceeding 150.
Formula: SUM(LET(a,A1,b,A1,c,INDEX(LET(query1,SUMMARIZE(A1,SUMX(E1)),FILTER(query1,CHOOSECOLS(query1,2)>150)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Formula2: SUM(LET(a,A2:A8,b,A2:A8,c,INDEX(LET(query1,SUMMARIZE(A2:A8,SUMX(E2:E8)),FILTER(query1,CHOOSECOLS(query1,2)>150)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Level: hard
Question: Mean weight for each year.
Formula: SUMMARIZE(H1,AVERAGEX(F1))
Formula2: SUMMARIZE(H2:H8,AVERAGEX(F2:F8))
Level: easy
Question: the mean horsepower for cars produced before 1980
Formula: LET(query1,FILTER(A1:I1,Year(H1)<1980),SUMMARIZE(CHOOSECOLS(query1,1),AVERAGEX(CHOOSECOLS(query1,5))))
Formula2: LET(query1,FILTER(A2:I8,Year(H1)<1980),SUMMARIZE(CHOOSECOLS(query1,1),AVERAGEX(CHOOSECOLS(query1,5))))
Level: hard
Question: the number of cars with more than 4 cylinders
Formula: SUM(LET(a,A1,b,A1,c,INDEX(LET(query1,SUMMARIZE(A1,SUMX(C1)),FILTER(query1,CHOOSECOLS(query1,2)>4)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Formula2: SUM(LET(a,A2:A8,b,A2:A8,c,INDEX(LET(query1,SUMMARIZE(A2:A8,SUMX(C2:C8)),FILTER(query1,CHOOSECOLS(query1,2)>4)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Level: hard
Question: How many cars have more than four cylinders?
Formula: SUM(LET(a,A1,b,A1,c,INDEX(LET(query1,SUMMARIZE(A1,SUMX(C1)),FILTER(query1,CHOOSECOLS(query1,2)>4)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Formula2: SUM(LET(a,A2:A8,b,A2:A8,c,INDEX(LET(query1,SUMMARIZE(A2:A8,SUMX(C2:C8)),FILTER(query1,CHOOSECOLS(query1,2)>4)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Level: hard
Question: Manufacturing years for cars weighing between 3000 and 4000.
Formula: LET(query1,SUMMARIZE(HSTACK(H1,A1),SUMX(F1)),FILTER(query1,(CHOOSECOLS(query1,3)>=3000)*(CHOOSECOLS(query1,3)<=4000)))
Formula2: LET(query1,SUMMARIZE(HSTACK(H2:H8,A2:A8),SUMX(F2:F8)),FILTER(query1,(CHOOSECOLS(query1,3)>=3000)*(CHOOSECOLS(query1,3)<=4000)))
Level: hard
Question: ids and manufacturing years of cars weighing between 3000 and 4000.
Formula: LET(query1,SUMMARIZE(HSTACK(A1,H1),SUMX(F1)),FILTER(query1,(CHOOSECOLS(query1,3)>=3000)*(CHOOSECOLS(query1,3)<=4000)))
Formula2: LET(query1,SUMMARIZE(HSTACK(A2:A8,H2:H8),SUMX(F2:F8)),FILTER(query1,(CHOOSECOLS(query1,3)>=3000)*(CHOOSECOLS(query1,3)<=4000)))
Level: hard
Question: the number of cars with more than 6 cylinders
Formula: SUM(LET(a,A1,b,A1,c,INDEX(LET(query1,SUMMARIZE(A1,SUMX(C1)),FILTER(query1,CHOOSECOLS(query1,2)>6)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Formula2: SUM(LET(a,A2:A8,b,A2:A8,c,INDEX(LET(query1,SUMMARIZE(A2:A8,SUMX(C2:C8)),FILTER(query1,CHOOSECOLS(query1,2)>6)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Level: hard
Question: the number of cars having horsepower above 150
Formula: SUM(LET(a,A1,b,A1,c,INDEX(LET(query1,SUMMARIZE(A1,SUMX(E1)),FILTER(query1,CHOOSECOLS(query1,2)>150)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Formula2: SUM(LET(a,A2:A8,b,A2:A8,c,INDEX(LET(query1,SUMMARIZE(A2:A8,SUMX(E2:E8)),FILTER(query1,CHOOSECOLS(query1,2)>150)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Level: hard
Question: the number of cars with horsepower above 150
Formula: SUM(LET(a,A1,b,A1,c,INDEX(LET(query1,SUMMARIZE(A1,SUMX(E1)),FILTER(query1,CHOOSECOLS(query1,2)>150)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Formula2: SUM(LET(a,A2:A8,b,A2:A8,c,INDEX(LET(query1,SUMMARIZE(A2:A8,SUMX(E2:E8)),FILTER(query1,CHOOSECOLS(query1,2)>150)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Level: hard
Question: the mean weight over years
Formula: SUMMARIZE(H1,AVERAGEX(F1))
Formula2: SUMMARIZE(H2:H8,AVERAGEX(F2:F8))
Level: easy
Question: How many cars having over 4 cylinders?
Formula: SUM(LET(a,A1,b,A1,c,INDEX(LET(query1,SUMMARIZE(A1,SUMX(C1)),FILTER(query1,CHOOSECOLS(query1,2)>4)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Formula2: SUM(LET(a,A2:A8,b,A2:A8,c,INDEX(LET(query1,SUMMARIZE(A2:A8,SUMX(C2:C8)),FILTER(query1,CHOOSECOLS(query1,2)>4)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Level: hard
Question: The ids and producing years of cars whose weight is between 3000 and 4000.
Formula: LET(a,HSTACK(A1,H1),b,A1,c,CHOOSECOLS(LET(query1,SUMMARIZE(A1,SUMX(F1)),FILTER(query1,(CHOOSECOLS(query1,2)>=3000)*(CHOOSECOLS(query1,2)<=4000))),1),UNIQUE(FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Formula2: LET(a,HSTACK(A2:A8,H2:H8),b,A2:A8,c,CHOOSECOLS(LET(query1,SUMMARIZE(A2:A8,SUMX(F2:F8)),FILTER(query1,(CHOOSECOLS(query1,2)>=3000)*(CHOOSECOLS(query1,2)<=4000))),1),UNIQUE(FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Level: hard