A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
You may try:
X and Y
=SUM(FILTER(D2:D7,(F2:F7="X")+(F2:F7="Y")))
X
=SUM(FILTER(D2:D7,(F2:F7="X")))
Y
=SUM(FILTER(D2:D7,(F2:F7="Y")))
What do you mean X or Y not exists? Not X and not Y?
=SUM(FILTER(D2:D7,(F2:F7<>"X")*(F2:F7<>"Y")))
If you filter on date in H2. mutiple "(TEXT(A2:A7,"MMYYYY")=TEXT(H2,"MMYYYY"))" in each criteria.
=SUM(FILTER(D2:D7,((F2:F7="X")+(F2:F7="Y"))*(TEXT(A2:A7,"MMYYYY")=TEXT(H2,"MMYYYY"))))