I am trying to sum total a range of cells between date ranges ie column n has $ amounts column d has the transaction dates ie 1/3/2015 or 25/3/2015 or 25/4/2015 column b has the text saying drp or distribution - reinv

In another cell I am trying to sum or total (in column n) with the value of a range of different dates (column d) that contain different text (column b) ie cell n48 is 50, n65 is 85, n165 is 36

with the dates ie cell d48 is 1/3/2015, d65 is 25/3/2015 and d165 is 25/4/2015

with different text that says drp or distribution - reinv ie cell b48 is drp, b65 is distribution - reinv, b165 is drp

If I wanted to sum the amounts between 1/3/2015 to 31/3/2015 with drp then the total would be 50. Also if I wanted to sum the amounts between 1/4/2015 to 30/4/2015 with drp the sum total would be 36 If I wanted to sum the amounts between 1/3/2015 to 31/3/2015 with drp and distribution - reinv the sum would be 115

What would the formula be for these different questions

hope you can help, it has been driving me nuts and cant work it out