Table:
0
A
B
C
D
E
F
1
Time
Customer
Salesman
Product
Price
Sales
2
1/1/2007
Tom
Mike
iPhone
800
1600
3
1/1/2008
Tom
Jack
Car
8000
8000

Questions and formulas:
Question: who buy the iphone
Formula: UNIQUE(CHOOSECOLS(FILTER(A1:F1,D1="iphone"),2))
Formula2: UNIQUE(CHOOSECOLS(FILTER(A2:F3,D2:D3="iphone"),2))
Level: medium
Question: When does Mike sell the iphone?
Formula: UNIQUE(CHOOSECOLS(FILTER(A1:F1,(D1="iphone")*(C1="mike")),1))
Formula2: UNIQUE(CHOOSECOLS(FILTER(A2:F3,(D2:D3="iphone")*(C2:C3="mike")),1))
Level: medium
Question: Who sells the most?
Formula: TAKE(SORT(SUMMARIZE(C1,SUMX(F1)), 2, -1), 1)
Formula2: TAKE(SORT(SUMMARIZE(C2:C3,SUMX(F2:F3)), 2, -1), 1)
Level: hard
Question: Who sold the most products by sales?
Formula: LET(a,HSTACK(C1,D1),b,D1,c,CHOOSECOLS(TAKE(SORT(SUMMARIZE(D1,SUMX(F1)), 2, -1), 1),1),UNIQUE(FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Formula2: LET(a,HSTACK(C2:C3,D2:D3),b,D2:D3,c,CHOOSECOLS(TAKE(SORT(SUMMARIZE(D2:D3,SUMX(F2:F3)), 2, -1), 1),1),UNIQUE(FILTER(a,NOT(ISNA(XLOOKUP(b,c,c))))))
Level: hard
Question: Best selling product
Formula: TAKE(SORT(SUMMARIZE(D1,SUMX(F1)), 2, -1), 1)
Formula2: TAKE(SORT(SUMMARIZE(D2:D3,SUMX(F2:F3)), 2, -1), 1)
Level: hard
Question: The most bought product
Formula: TAKE(SORT(SUMMARIZE(D1,SUMX(F1)), 2, -1), 1)
Formula2: TAKE(SORT(SUMMARIZE(D2:D3,SUMX(F2:F3)), 2, -1), 1)
Level: hard
Question: Top product by selling number
Formula: TAKE(SORT(SUMMARIZE(D1,SUMX(F1)), 2, -1), 1)
Formula2: TAKE(SORT(SUMMARIZE(D2:D3,SUMX(F2:F3)), 2, -1), 1)
Level: hard
Question: What is sold by Mike
Formula: UNIQUE(CHOOSECOLS(FILTER(A1:F1,C1="mike"),4))
Formula2: UNIQUE(CHOOSECOLS(FILTER(A2:F3,C2:C3="mike"),4))
Level: medium
Question: What is bought by Tom
Formula: UNIQUE(CHOOSECOLS(FILTER(A1:F1,B1="tom"),4))
Formula2: UNIQUE(CHOOSECOLS(FILTER(A2:F3,B2:B3="tom"),4))
Level: medium
Question: Who sold iphone most
Formula: TAKE(SORT(LET(query1,FILTER(A1:F1,D1="iphone"),SUMMARIZE(CHOOSECOLS(query1,3),SUMX(CHOOSECOLS(query1,6)))), 2, -1), 1)
Formula2: TAKE(SORT(LET(query1,FILTER(A2:F3,D2:D3="iphone"),SUMMARIZE(CHOOSECOLS(query1,3),SUMX(CHOOSECOLS(query1,6)))), 2, -1), 1)
Level: hard
Question: How many products are sold
Formula: ROWS(UNIQUE(D1))
Formula2: ROWS(UNIQUE(D2:D3))
Level: easy
Question: How many products are sold in 2017
Formula: ROWS(UNIQUE(FILTER(D1, Year(A1)=2017)))
Formula2: ROWS(UNIQUE(FILTER(D2:D3, Year(A1)=2017)))
Level: medium
Question: When did Tom buy the Car
Formula: UNIQUE(CHOOSECOLS(FILTER(A1:F1,(B1="tom")*(D1="car")),1))
Formula2: UNIQUE(CHOOSECOLS(FILTER(A2:F3,(B2:B3="tom")*(D2:D3="car")),1))
Level: medium
Question: Who sold the least iphone
Formula: TAKE(SORT(LET(query1,FILTER(A1:F1,D1="iphone"),SUMMARIZE(CHOOSECOLS(query1,3),SUMX(CHOOSECOLS(query1,6)))), 2, 1), 1)
Formula2: TAKE(SORT(LET(query1,FILTER(A2:F3,D2:D3="iphone"),SUMMARIZE(CHOOSECOLS(query1,3),SUMX(CHOOSECOLS(query1,6)))), 2, 1), 1)
Level: hard
Question: Who sold the product to Tom
Formula: LET(query1,FILTER(A1:F1,B1="tom"),UNIQUE(CHOOSECOLS(query1,4,3)))
Formula2: LET(query1,FILTER(A2:F3,B2:B3="tom"),UNIQUE(CHOOSECOLS(query1,4,3)))
Level: hard
Question: how many products does Tom bought
Formula: ROWS(UNIQUE(FILTER(D1, B1="tom")))
Formula2: ROWS(UNIQUE(FILTER(D2:D3, B2:B3="tom")))
Level: medium
Question: When did the iPhone sold
Formula: UNIQUE(CHOOSECOLS(FILTER(A1:F1,D1="iphone"),1))
Formula2: UNIQUE(CHOOSECOLS(FILTER(A2:F3,D2:D3="iphone"),1))
Level: medium
Question: Who buy iphone and car
Formula: UNIQUE(CHOOSECOLS(FILTER(A1:F1,(D1="car")+(D1="iphone")),2))
Formula2: UNIQUE(CHOOSECOLS(FILTER(A2:F3,(D2:D3="car")+(D2:D3="iphone")),2))
Level: medium
Question: Who sold iphone to whom
Formula: LET(query1,FILTER(A1:F1,D1="iphone"),UNIQUE(CHOOSECOLS(query1,2,3)))
Formula2: LET(query1,FILTER(A2:F3,D2:D3="iphone"),UNIQUE(CHOOSECOLS(query1,2,3)))
Level: hard
Question: which product has most rows
Formula: TAKE(SORT(SUMMARIZE(D1,COUNTX(D1)), 2, -1), 1)
Formula2: TAKE(SORT(SUMMARIZE(D2:D3,COUNTX(D2:D3)), 2, -1), 1)
Level: hard
Question: which one sells most
Formula: TAKE(SORT(SUMMARIZE(D1,SUMX(F1)), 2, -1), 1)
Formula2: TAKE(SORT(SUMMARIZE(D2:D3,SUMX(F2:F3)), 2, -1), 1)
Level: hard
Question: in 1999, who sold the most
Formula: TAKE(SORT(LET(query1,FILTER(A1:F1,Year(A1)=1999),SUMMARIZE(CHOOSECOLS(query1,3),SUMX(CHOOSECOLS(query1,6)))), 2, -1), 1)
Formula2: TAKE(SORT(LET(query1,FILTER(A2:F3,Year(A1)=1999),SUMMARIZE(CHOOSECOLS(query1,3),SUMX(CHOOSECOLS(query1,6)))), 2, -1), 1)
Level: hard
Question: in 1999 who sold the most
Formula: TAKE(SORT(LET(query1,FILTER(A1:F1,Year(A1)=1999),SUMMARIZE(CHOOSECOLS(query1,3),SUMX(CHOOSECOLS(query1,6)))), 2, -1), 1)
Formula2: TAKE(SORT(LET(query1,FILTER(A2:F3,Year(A1)=1999),SUMMARIZE(CHOOSECOLS(query1,3),SUMX(CHOOSECOLS(query1,6)))), 2, -1), 1)
Level: hard