Table:
0
A
B
C
D
E
F
1
Emperor
Heir
Relationship to emperor and status
Became heir
Ceased to be heir
Next in line
2
Francis II
Crown Prince Ferdinand
Son Heir apparent
11 August 1804; foundation of the Empire
2 March 1835; succeeded
Archduke Joseph Franz 1804–1807, brother
3
Francis II
Crown Prince Ferdinand
Son Heir apparent
11 August 1804; foundation of the Empire
2 March 1835; succeeded
Archduke Franz Karl 1807–1835, brother
4
Ferdinand I
Archduke Franz Karl
Brother Heir presumptive
2 March 1835; brother succeeded
2 December 1848; renounced his succession rights
Archduke Franz ' 1835–1848, son
5
Franz Joseph I
Archduke Ferdinand Maximilian
Brother Heir presumptive
2 December 1848; brother succeeded
21 August 1858; son born to Emperor
Archduke Karl Ludwig 1848–1858, brother
6
Franz Joseph I
Crown Prince Rudolf
Son Heir apparent
21 August 1858; born
30 January 1889; died
Archduke Ferdinand Maximilian 1858–1864, uncle
7
Franz Joseph I
Crown Prince Rudolf
Son Heir apparent
21 August 1858; born
30 January 1889; died
Archduke Karl Ludwig 1864–1889, uncle
8
Franz Joseph I
Archduke Karl Ludwig
Brother Heir presumptive
30 January 1889; nephew died
1 February 1889; renounced his succession rights
Archduke Franz Ferdinand 1889, son
9
Franz Joseph I
Archduke Karl
Grandnephew Heir presumptive
28 June 1914; Death of his uncle
21 November 1916; succeeded
Archduke Maximilian Eugen 1906–1912, brother
10
Franz Joseph I
Archduke Karl
Grandnephew Heir presumptive
28 June 1914; Death of his uncle
21 November 1916; succeeded
Archduke Otto 1912–1916, son
11
Karl I
Crown Prince Otto
Son Heir apparent
21 November 1916; father succeeded
12 November 1918; Empire replaced by republic
Archduke Robert 1916–1918, brother

Questions and formulas:
Question: How many next in lines had heirs of Archduke Karl?
Formula: ROWS(UNIQUE(FILTER(F1, B1="Archduke Karl")))
Formula2: ROWS(UNIQUE(FILTER(F2:F11, B2:B11="Archduke Karl")))
Level: medium