Table:
0
A
B
C
D
E
F
1
District
Incumbent
Party
First elected
Result
Candidates
2
Virginia 1
John G. Jackson
Democratic-Republican
1803
Re-elected
John G. Jackson (DR) 60.3% Noah Linsey (F) 29.7%
3
Virginia 2
John Morrow
Democratic-Republican
1805
Lost re-election Federalist gain
James Stephenson (F) 57.6% John Morrow (DR) 42.4%
4
Virginia 3
John Smith
Democratic-Republican
1801
Re-elected
John Smith (DR) 87.0% Robert Page (F) 13.0%
5
Virginia 4
David Holmes
Democratic-Republican
1797
Retired Federalist gain
Jacob Swoope (F) 53.7% Daniel Smith (DR) 46.3%
6
Virginia 9
John Love
Democratic-Republican
1807
Re-elected
John Love (DR)
7
Virginia 10
John Dawson
Democratic-Republican
1797
Re-elected
John Dawson (DR) 100%
8
Virginia 11
James M. Garnett
Democratic-Republican
1805
Retired Democratic-Republican hold
John Roane (DR) 53.7% John T. Woodford (F) 46.3%
9
Virginia 12
Burwell Bassett
Democratic-Republican
1805
Re-elected
Burwell Bassett (DR) 57.4% John Eyre (F) 42.6%
10
Virginia 13
William A. Burwell
Democratic-Republican
1806 (special)
Re-elected
William A. Burwell (DR) 100%
11
Virginia 14
Matthew Clay
Democratic-Republican
1797
Re-elected
Matthew Clay (DR) 100%
12
Virginia 15
John Randolph
Democratic-Republican
1799
Re-elected
John Randolph (DR) 71.5% Jerman Baker (DR) 28.5%
13
Virginia 16
John W. Eppes
Democratic-Republican
1803
Re-elected
John W. Eppes (DR) 100%
14
Virginia 18
Peterson Goodwyn
Democratic-Republican
1803
Re-elected
Peterson Goodwyn (DR) 70.5% John Pegram (F?) 29.5%

Questions and formulas:
Question: Who was the incumbent in the district that first elected someone in 1807?
Formula: UNIQUE(CHOOSECOLS(FILTER(A1:F1,D1=1807),2))
Formula2: UNIQUE(CHOOSECOLS(FILTER(A2:F14,D2:D14=1807),2))
Level: medium
Question: When was someone first elected in the district with incumbent john smith?
Formula: UNIQUE(CHOOSECOLS(FILTER(A1:F1,B1="John Smith"),4))
Formula2: UNIQUE(CHOOSECOLS(FILTER(A2:F14,B2:B14="John Smith"),4))
Level: medium
Question: What party represents the district with incumbent matthew clay?
Formula: UNIQUE(CHOOSECOLS(FILTER(A1:F1,B1="Matthew Clay"),3))
Formula2: UNIQUE(CHOOSECOLS(FILTER(A2:F14,B2:B14="Matthew Clay"),3))
Level: medium
Question: What party represents the district with john g. jackson?
Formula: UNIQUE(CHOOSECOLS(FILTER(A1:F1,B1="John G. Jackson"),3))
Formula2: UNIQUE(CHOOSECOLS(FILTER(A2:F14,B2:B14="John G. Jackson"),3))
Level: medium