Sum cells based on number of months
This array* formula will do the trick:
=SUM(IF((MOD(COLUMN(C5:Y5),2)=1)*(INT((COLUMN(C5:Y 5)-1)/2)
<=A1),C5:Y5))
* An array formula has to be committed using the key combination of
Ctrl-Shift-Enter (CSE) rather than the usual Enter. If you do this
correclty then Excel will wrap the formula in curly braces { } when
viewed in the formula bar - do not type these yourself. If you edit
the formula you will need to use CSE again.
Hope this helps.
Pete
On Jul 23, 7:56*pm, rck wrote:
What would the formula be to add 7 months worth of data based on an index.. *
i.e I have 12 cells with data but only want to add say 7 of them for YTD data
through july. *If I use and index number of say 7 in cell a1 what would the
formula be to add only the first 7 cells listed out of 12 cells -
c5,e5,g5,i5,k5,m5,o5,q5,s5,u5,w5,y5 *Hope this makes sense.
|