Hi!
I'm trying to make a formula for the whole spreadsheet that adds up certain cells.
The range of cells I want to add up start from C8 and then I want to add up every 12th row up to cell C596. Like {C8, C20, C32, C44 ... C596}
I've tried =SUMPRODUCT((MOD((ROW(C8:C596)-8),12)=0)*(C8:C596))
But it didn't work and what *(C8:C596) does I don't really understand.
I'd be glad to hear how I could get it done, either by improving this formula or by a completely different way.
Thanks!
Eli
Last edited by EliHolle; 04-08-2011 at 09:01 AM. Reason: problem solved
Is this what you're trying for:
=SUMPRODUCT((MOD(ROW(C8:C596)+4,12)=0)*(C8:C596))
That formula looks like it should work, unless you have text in any of those non-contiguous cells in the range. Then you would get the #VALUE! error.
the first part of the formula produces an array of TRUE or FALSE to mark every 12 entry... the multiplication of the entire array is basically multiplying each TRUE and FALSE by each corresponding value in the range... a TRUE multiplied by a number produces that number, a FALSE multiplied by a number produces 0 so then the sumproduct adds these all up...to give result.
If you have a text value in any of those cells that match up to a TRUE, you will get
If you have text in there, try:
=SUMPRODUCT(--(MOD((ROW(C8:C596)-8),12)=0),(C8:C596))
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
Cutter, NBVC
Thank you for your fast aswers and sorry for my late repy.
The formula with (-- worked!! I had some text in the cells in this range and indeed got the #value error.
I'm really amazed by your fast and accurate answers. Many, many thanks!!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks