You will need to use a Sumproduct() based formula for multiple conditions...
e.g.
To Count
=Sumproduct(--('Table 2 sheet'!$A$1:$A$100=A2),--('Table 2 sheet'!$B$1:$B$100>=B2),--('Table 2 sheet'!$B$1:$B$100<=Date(Year(B2),Month(B2)+3,Day(B2)))
To Sum:
=Sumproduct(--('Table 2 sheet'!$A$1:$A$100=A2),--('Table 2 sheet'!$B$1:$B$100>=B2),--('Table 2 sheet'!$B$1:$B$100<=Date(Year(B2),Month(B2)+3,Day(B2)),'Table 2 sheet'!$C$1:$C$100)
Where
Table 2 sheet'!$A$1:$C$100 is the sheet and range the database is on.
Adjust ranges to suit.
Bookmarks