Table:
0
A
B
C
D
E
1
pet id
pet type
pet age
weight
pets
2
2001
cat
3
12.0
3
2002
dog
2
13.4
4
2003
dog
1
9.3

Questions and formulas:
Question: Find the number of pets whose weight is heavier than 10.
Formula: ROWS(UNIQUE(LET(a,E1,b,E1,c,INDEX(LET(query1,SUMMARIZE(E1,SUMX(D1)),FILTER(query1,CHOOSECOLS(query1,2)>10)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c)))))))
Formula2: ROWS(UNIQUE(LET(a,E2:E4,b,E2:E4,c,INDEX(LET(query1,SUMMARIZE(E2:E4,SUMX(D2:D4)),FILTER(query1,CHOOSECOLS(query1,2)>10)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c)))))))
Level: hard
Question: How many pets have a greater weight than 10?
Formula: ROWS(UNIQUE(LET(a,E1,b,E1,c,INDEX(LET(query1,SUMMARIZE(E1,SUMX(D1)),FILTER(query1,CHOOSECOLS(query1,2)=10)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c)))))))
Formula2: ROWS(UNIQUE(LET(a,E2:E4,b,E2:E4,c,INDEX(LET(query1,SUMMARIZE(E2:E4,SUMX(D2:D4)),FILTER(query1,CHOOSECOLS(query1,2)=10)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c)))))))
Level: hard
Question: Find the maximum weight for each type of pet.
Formula: SUMMARIZE(HSTACK(B1,E1),MAXX(D1))
Formula2: SUMMARIZE(HSTACK(B2:B4,E2:E4),MAXX(D2:D4))
Level: medium
Question: List the maximum weight and type for each type of pet.
Formula: SUMMARIZE(HSTACK(B1,E1),MAXX(D1))
Formula2: SUMMARIZE(HSTACK(B2:B4,E2:E4),MAXX(D2:D4))
Level: medium
Question: Find the number of distinct type of pets.
Formula: ROWS(UNIQUE(B1))
Formula2: ROWS(UNIQUE(B2:B4))
Level: easy
Question: How many different types of pet are there?
Formula: ROWS(UNIQUE(B1))
Formula2: ROWS(UNIQUE(B2:B4))
Level: easy
Question: Find the average weight for each pet type.
Formula: SUMMARIZE(B1,AVERAGEX(D1))
Formula2: SUMMARIZE(B2:B4,AVERAGEX(D2:D4))
Level: easy
Question: What is the average weight for each type of pet?
Formula: SUMMARIZE(HSTACK(B1,E1),AVERAGEX(D1))
Formula2: SUMMARIZE(HSTACK(B2:B4,E2:E4),AVERAGEX(D2:D4))
Level: medium
Question: How many pets are heavier than 10?
Formula: ROWS(UNIQUE(LET(a,E1,b,E1,c,INDEX(LET(query1,SUMMARIZE(E1,SUMX(D1)),FILTER(query1,CHOOSECOLS(query1,2)>10)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c)))))))
Formula2: ROWS(UNIQUE(LET(a,E2:E4,b,E2:E4,c,INDEX(LET(query1,SUMMARIZE(E2:E4,SUMX(D2:D4)),FILTER(query1,CHOOSECOLS(query1,2)>10)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c)))))))
Level: hard
Question: How many pets which weigh 10?
Formula: ROWS(UNIQUE(LET(a,E1,b,E1,c,INDEX(LET(query1,SUMMARIZE(E1,SUMX(D1)),FILTER(query1,CHOOSECOLS(query1,2)=10)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c)))))))
Formula2: ROWS(UNIQUE(LET(a,E2:E4,b,E2:E4,c,INDEX(LET(query1,SUMMARIZE(E2:E4,SUMX(D2:D4)),FILTER(query1,CHOOSECOLS(query1,2)=10)),,1),FILTER(a,NOT(ISNA(XLOOKUP(b,c,c)))))))
Level: hard
Question: The heaviest pet's type and pets information.
Formula: TAKE(SORT(SUMMARIZE(HSTACK(E1,B1),SUMX(D1)), 3, -1), 1)
Formula2: TAKE(SORT(SUMMARIZE(HSTACK(E2:E4,B2:B4),SUMX(D2:D4)), 3, -1), 1)
Level: hard
Question: How many different types of pet are there?
Formula: SUMMARIZE(E1,DCOUNTX(B1))
Formula2: SUMMARIZE(E2:E4,DCOUNTX(B2:B4))
Level: easy
Question: Total pet types and pets respectively
Formula: HSTACK(ROWS(UNIQUE(B1)), ROWS(UNIQUE(E1)))
Formula2: HSTACK(ROWS(UNIQUE(B2:B4)), ROWS(UNIQUE(E2:E4)))
Level: hard
Question: The average weight of each pet type.
Formula: SUMMARIZE(B1,AVERAGEX(D1))
Formula2: SUMMARIZE(B2:B4,AVERAGEX(D2:D4))
Level: easy
Question: the type and pets information of the heaviest pet
Formula: TAKE(SORT(SUMMARIZE(HSTACK(B1,E1),SUMX(D1)), 3, -1), 1)
Formula2: TAKE(SORT(SUMMARIZE(HSTACK(B2:B4,E2:E4),SUMX(D2:D4)), 3, -1), 1)
Level: hard
Question: The number of types for pets.
Formula: SUMMARIZE(E1,DCOUNTX(B1))
Formula2: SUMMARIZE(E2:E4,DCOUNTX(B2:B4))
Level: easy
Question: The number of pet types and pets.
Formula: HSTACK(ROWS(UNIQUE(B1)), ROWS(UNIQUE(E1)))
Formula2: HSTACK(ROWS(UNIQUE(B2:B4)), ROWS(UNIQUE(E2:E4)))
Level: hard