Table:
0
A
B
C
D
E
F
1
District
Incumbent
Party
First elected
Result
Candidates
2
Virginia 3
Henry St. George Tucker
Democratic-Republican
1815
Retired Democratic-Republican hold
Jared Williams (DR) 64.6% John Smith (DR) 35.4%
3
Virginia 4
William McCoy
Democratic-Republican
1811
Re-elected
William McCoy (DR) 100%
4
Virginia 5
John Floyd
Democratic-Republican
1817
Re-elected
John Floyd (DR) 100%
5
Virginia 6
Alexander Smyth
Democratic-Republican
1817
Re-elected
Alexander Smyth (DR) 100%
6
Virginia 7
Ballard Smith
Democratic-Republican
1815
Re-elected
Ballard Smith (DR)
7
Virginia 8
Charles F. Mercer
Federalist
1817
Re-elected
Charles F. Mercer (F) 100%
8
Virginia 11
Philip P. Barbour
Democratic-Republican
1814 (special)
Re-elected
Philip P. Barbour (DR) 100%
9
Virginia 12
Robert S. Garnett
Democratic-Republican
1817
Re-elected
Robert S. Garnett (DR)
10
Virginia 13
Burwell Bassett
Democratic-Republican
1815
Retired Democratic-Republican hold
Severn E. Parker (DR) John Drury
11
Virginia 14
William A. Burwell
Democratic-Republican
1806 (special)
Re-elected
William A. Burwell (DR)
12
Virginia 15
William J. Lewis
Democratic-Republican
1817
Retired Democratic-Republican hold
George Tucker (DR) 72.2% John Kerr (DR) 27.8%
13
Virginia 17
James Pleasants
Democratic-Republican
1811
Re-elected
James Pleasants (DR)
14
Virginia 19
John Pegram
Democratic-Republican
1818 ( special )
Lost re-election Democratic-Republican hold
James Jones (DR) 70.6% John Pegram (DR) 29.4%
15
Virginia 20
James Johnson
Democratic-Republican
1813
Re-elected
James Johnson (DR) 100%
16
Virginia 21
Thomas Newton, Jr.
Democratic-Republican
1797
Re-elected
Thomas Newton, Jr. (DR) 100%
17
Virginia 22
Hugh Nelson
Democratic-Republican
1811
Re-elected
Hugh Nelson (DR)

Questions and formulas:
Question: Who are the candidates when the incumbent is john pegram?
Formula: UNIQUE(CHOOSECOLS(FILTER(A1:F1,B1="John Pegram"),6))
Formula2: UNIQUE(CHOOSECOLS(FILTER(A2:F17,B2:B17="John Pegram"),6))
Level: medium
Question: Who are the candidates for district virginia 12?
Formula: UNIQUE(CHOOSECOLS(FILTER(A1:F1,A1="Virginia 12"),6))
Formula2: UNIQUE(CHOOSECOLS(FILTER(A2:F17,A2:A17="Virginia 12"),6))
Level: medium
Question: What is the result when the candidates are alexander smyth (dr) 100%
Formula: UNIQUE(CHOOSECOLS(FILTER(A1:F1,F1="Alexander Smyth (DR) 100%"),5))
Formula2: UNIQUE(CHOOSECOLS(FILTER(A2:F17,F2:F17="Alexander Smyth (DR) 100%"),5))
Level: medium
Question: How many times is the candidates charles f. mercer (f) 100%?
Formula: ROWS(UNIQUE(FILTER(B1, F1="Charles F. Mercer (F) 100%")))
Formula2: ROWS(UNIQUE(FILTER(B2:B17, F2:F17="Charles F. Mercer (F) 100%")))
Level: medium