Table:
0
A
B
C
D
E
1
Election
1st Member
1st Party
2nd Member
2nd Party
2
1832
John Brocklehurst
Liberal
John Ryle
Conservative
3
1837
John Brocklehurst
Liberal
Thomas Grimsditch
Conservative
4
1847
John Brocklehurst
Liberal
John Williams
Conservative
5
1852
John Brocklehurst
Liberal
Edward Christopher Egerton
Conservative
6
1868
William Coare Brocklehurst
Liberal
David Chadwick
Liberal
7
1880
writ suspended
writ suspended
writ suspended
writ suspended

Questions and formulas:
Question: Which 1st member has Thomas Grimsditch as a 2nd member?
Formula: UNIQUE(CHOOSECOLS(FILTER(A1:E1,D1="thomas grimsditch"),2))
Formula2: UNIQUE(CHOOSECOLS(FILTER(A2:E7,D2:D7="thomas grimsditch"),2))
Level: medium
Question: What is all the total election that has conservative as 2nd party?
Formula: SUMIFS(A1,E1,"conservative")
Formula2: SUMIFS(A2:A7,E2:E7,"conservative")
Level: easy
Question: Which 1st party has John Brocklehurst as 1st member, Edward Christopher Egerton 2nd memeber, and election smaller than 1880?
Formula: LET(query1,LET(query1,FILTER(A1:E1,(B1="john brocklehurst")*(D1="edward christopher egerton")),SUMMARIZE(CHOOSECOLS(query1,3),SUMX(CHOOSECOLS(query1,1)))),FILTER(query1,CHOOSECOLS(query1,2)<1880))
Formula2: LET(query1,LET(query1,FILTER(A2:E7,(B2:B7="john brocklehurst")*(D2:D7="edward christopher egerton")),SUMMARIZE(CHOOSECOLS(query1,3),SUMX(CHOOSECOLS(query1,1)))),FILTER(query1,CHOOSECOLS(query1,2)<1880))
Level: hard
Question: Which 1st party has 2nd party conservative, election smaller than 1852, and Thomas Grimsditch as 2nd member?
Formula: LET(query1,LET(query1,FILTER(A1:E1,(E1="conservative")*(D1="thomas grimsditch")),SUMMARIZE(CHOOSECOLS(query1,3),SUMX(CHOOSECOLS(query1,1)))),FILTER(query1,CHOOSECOLS(query1,2)<1852))
Formula2: LET(query1,LET(query1,FILTER(A2:E7,(E2:E7="conservative")*(D2:D7="thomas grimsditch")),SUMMARIZE(CHOOSECOLS(query1,3),SUMX(CHOOSECOLS(query1,1)))),FILTER(query1,CHOOSECOLS(query1,2)<1852))
Level: hard