Table:
0
A
B
C
D
E
1
District
Incumbent
Party
First elected
Result
2
South Carolina 1
Samuel Dibble
Democratic
1882
Retired Democratic hold
3
South Carolina 2
George D. Tillman
Democratic
1878
Re-elected
4
South Carolina 3
James S. Cothran
Democratic
1886
Retired Democratic hold
5
South Carolina 4
William H. Perry
Democratic
1884
Retired Democratic hold
6
South Carolina 5
John J. Hemphill
Democratic
1882
Re-elected
7
South Carolina 6
George W. Dargan
Democratic
1882
Retired Democratic hold
8
South Carolina 7
Thomas E. Miller
Republican
1888
Lost re-election Democratic gain

Questions and formulas:
Question: Which party had a result of retired democratic hold and a first elected earlier than 1884 with an incumbent of samuel dibble?
Formula: LET(query1,LET(query1,FILTER(A1:E1,(E1="retired democratic hold")*(B1="samuel dibble")),SUMMARIZE(CHOOSECOLS(query1,3),SUMX(CHOOSECOLS(query1,4)))),FILTER(query1,CHOOSECOLS(query1,2)<1884))
Formula2: LET(query1,LET(query1,FILTER(A2:E8,(E2:E8="retired democratic hold")*(B2:B8="samuel dibble")),SUMMARIZE(CHOOSECOLS(query1,3),SUMX(CHOOSECOLS(query1,4)))),FILTER(query1,CHOOSECOLS(query1,2)<1884))
Level: hard
Question: Which district had a first elected in 1882 with a result of re-elected?
Formula: LET(query1,LET(query1,FILTER(A1:E1,E1="re-elected"),SUMMARIZE(CHOOSECOLS(query1,1),SUMX(CHOOSECOLS(query1,4)))),FILTER(query1,CHOOSECOLS(query1,2)=1882))
Formula2: LET(query1,LET(query1,FILTER(A2:E8,E2:E8="re-elected"),SUMMARIZE(CHOOSECOLS(query1,1),SUMX(CHOOSECOLS(query1,4)))),FILTER(query1,CHOOSECOLS(query1,2)=1882))
Level: hard