Table:
0
A
B
C
D
E
F
1
District
Incumbent
Party
First elected
Result
Candidates
2
South Carolina 1
Samuel Dibble
Democratic
1882
Re-elected
Samuel Dibble (D) 99.9% Others 0.1%
3
South Carolina 2
George D. Tillman
Democratic
1878
Re-elected
George D. Tillman (D) 99.6% Others 0.4%
4
South Carolina 3
D. Wyatt Aiken
Democratic
1876
Retired Democratic hold
James S. Cothran (D) 99.8% Others 0.2%
5
South Carolina 4
William H. Perry
Democratic
1884
Re-elected
William H. Perry (D) 100%
6
South Carolina 5
John J. Hemphill
Democratic
1882
Re-elected
John J. Hemphill (D) 99.9% Others 0.1%

Questions and formulas:
Question: Who were all candidate when incumbent was D. Wyatt Aiken?
Formula: UNIQUE(CHOOSECOLS(FILTER(A1:F1,B1="D. Wyatt Aiken"),6))
Formula2: UNIQUE(CHOOSECOLS(FILTER(A2:F6,B2:B6="D. Wyatt Aiken"),6))
Level: medium
Question: How many incumbents for the district of South Carolina 5?
Formula: ROWS(UNIQUE(FILTER(B1, A1="South Carolina 5")))
Formula2: ROWS(UNIQUE(FILTER(B2:B6, A2:A6="South Carolina 5")))
Level: medium
Question: Who was everyone first elected when incumbent was John J. Hemphill?
Formula: SUMIFS(D1,B1,"John J. Hemphill")
Formula2: SUMIFS(D2:D6,B2:B6,"John J. Hemphill")
Level: easy