Table:
0
A
B
C
D
E
1
church id
male id
female id
year
wedding
2
1
1
2
2014
3
3
3
4
2015
4
5
5
6
2016
5
4
7
8
2016

Questions and formulas:
Question: How many weddings are there in year 2016?
Formula: ROWS(UNIQUE(FILTER(E1, Year(D1)=2016)))
Formula2: ROWS(UNIQUE(FILTER(E2:E5, Year(D1)=2016)))
Level: medium
Question: How many churches have a wedding in year 2016?
Formula: ROWS(UNIQUE(FILTER(A1,D1=2016)))
Formula2: ROWS(UNIQUE(FILTER(A2:A5,D2:D5=2016)))
Level: medium
Question: number of churches and weddings in 2016 respectively
Formula: HSTACK(SUM(FILTER(A1, Year(D1)=2016)),ROWS(UNIQUE(FILTER(E1, Year(D1)=2016))))
Formula2: HSTACK(SUM(FILTER(A2:A5, Year(D1)=2016)),ROWS(UNIQUE(FILTER(E2:E5, Year(D1)=2016))))
Level: hard
Question: How many weddings were held in 2016?
Formula: ROWS(UNIQUE(FILTER(E1, Year(D1)=2016)))
Formula2: ROWS(UNIQUE(FILTER(E2:E5, Year(D1)=2016)))
Level: medium
Question: the respective number of churches and weddings in 2016.
Formula: HSTACK(SUM(FILTER(A1, Year(D1)=2016)),ROWS(UNIQUE(FILTER(E1, Year(D1)=2016))))
Formula2: HSTACK(SUM(FILTER(A2:A5, Year(D1)=2016)),ROWS(UNIQUE(FILTER(E2:E5, Year(D1)=2016))))
Level: hard