Table:
0
A
B
C
D
E
1
Province
Provincial capital
Largest city
Area (km 2 )
Population (2013)
2
Eastern Cape
Bhisho
Port Elizabeth
168966
6620100
3
Free State
Bloemfontein
Bloemfontein
129825
2753200
4
Gauteng
Johannesburg
Johannesburg
18178
12728400
5
KwaZulu-Natal
Pietermaritzburg
Durban
94361
10456900
6
Limpopo
Polokwane
Polokwane
125754
5518000
7
Mpumalanga
Nelspruit
Nelspruit
76495
4128000
8
North West
Mahikeng
Rustenburg
104882
3597600
9
Northern Cape
Kimberley
Kimberley
372889
1162900

Questions and formulas:
Question: what is the largest city where the population is 6620100?
Formula: LET(query1,SUMMARIZE(C1,SUMX(E1)),FILTER(query1,CHOOSECOLS(query1,2)=6620100))
Formula2: LET(query1,SUMMARIZE(C2:C9,SUMX(E2:E9)),FILTER(query1,CHOOSECOLS(query1,2)=6620100))
Level: hard
Question: what is the largest city where the province is eastern cape?
Formula: UNIQUE(CHOOSECOLS(FILTER(A1:E1,A1="Eastern Cape"),3))
Formula2: UNIQUE(CHOOSECOLS(FILTER(A2:E9,A2:A9="Eastern Cape"),3))
Level: medium
Question: what is minimum area where the largest city is bloemfontein?
Formula: MINIFS(D1,C1,"Bloemfontein")
Formula2: MINIFS(D2:D9,C2:C9,"Bloemfontein")
Level: easy
Question: what is the numbe of provincial captial where the population is 1162900?
Formula: LET(query1,SUMMARIZE(B1,SUMX(E1)),FILTER(query1,CHOOSECOLS(query1,2)=1162900))
Formula2: LET(query1,SUMMARIZE(B2:B9,SUMX(E2:E9)),FILTER(query1,CHOOSECOLS(query1,2)=1162900))
Level: hard
Question: what is the number of provincial captial where the province is northern cape?
Formula: UNIQUE(CHOOSECOLS(FILTER(A1:E1,A1="Northern Cape"),2))
Formula2: UNIQUE(CHOOSECOLS(FILTER(A2:E9,A2:A9="Northern Cape"),2))
Level: medium