Table:
0
A
B
C
D
1
location code
location name
location description
reference locations
2
b
Brazil
3
c
Canada
4
e
Edinburgh
5
n
Nanjing
6
x
Xiamen

Questions and formulas:
Question: Show the number of locations.
Formula: ROWS(UNIQUE(A1))
Formula2: ROWS(UNIQUE(A2:A6))
Level: easy
Question: How many locations are listed in the database?
Formula: ROWS(UNIQUE(A1))
Formula2: ROWS(UNIQUE(A2:A6))
Level: easy
Question: List all location codes and location names.
Formula: UNIQUE(HSTACK(A1,B1))
Formula2: UNIQUE(HSTACK(A2:A6,B2:B6))
Level: easy
Question: What are all the location codes and location names?
Formula: UNIQUE(HSTACK(A1,B1))
Formula2: UNIQUE(HSTACK(A2:A6,B2:B6))
Level: easy
Question: What are the name and description for location code x?
Formula: LET(query1,FILTER(A1:D1,A1="x"),UNIQUE(CHOOSECOLS(query1,2,3)))
Formula2: LET(query1,FILTER(A2:D6,A2:A6="x"),UNIQUE(CHOOSECOLS(query1,2,3)))
Level: hard
Question: What is the location code for the country "Canada"?
Formula: UNIQUE(CHOOSECOLS(FILTER(A1:D1,B1="canada"),1))
Formula2: UNIQUE(CHOOSECOLS(FILTER(A2:D6,B2:B6="canada"),1))
Level: medium
Question: Show the location code of the country "Canada".
Formula: UNIQUE(CHOOSECOLS(FILTER(A1:D1,B1="canada"),1))
Formula2: UNIQUE(CHOOSECOLS(FILTER(A2:D6,B2:B6="canada"),1))
Level: medium