OK, spent all day trying to figure out how to do this and still can't get it to work.
Column B is a column of Dates, say Jan 2010 to Dec 2060 at monthly intervals
Column F is the £ income value for each month.
Cell A1 allows the user to enter any date
I need a formula to look at the date in Cell A1 and then sum the total income for the appropriate quarter that this date falls in (assumes standard year quarters of Mar, Jun, Sept and Dec), so for example if the user enters April 4th 2012 in Cell A1, this falls into the second quarter, so my formula needs to total the income from Column F for April, May and June 2012.
I have no problem identifying the quarter that the date falls in using
=ROUNDUP(MONTH($A$1)/3,0)
but I am struggling to get my formula to identify all the months that fall in the quarter and then sum the income for just those months from Column F. Every variation I've tried returns zero.
I've tried variations on SUMPRODUCT and SUMIFS:
=SUMPRODUCT(--($B$1:$B$360=YEAR($A$1)),--($B$1:$B$360=ROUNDUP(MONTH($A$1)/3,0)),--($F$1:$F$360))
YEAR($A$1) identifies the year correctly, ROUNDUP(MONTH($A$1)/3,0), identifies the correct quarter but I realise that this maybe where my formula is not right.
Can anyone please help as I can't figure this one out.
Ultimately I am looking to use the formula to calculate income for the current quarter (based on the date entered in A1), the previous quarter and following quarter, which will all be variations on the same formula...
Many thanks
Bookmarks