Sum Every Nth Row

AlbertS

New Member
Joined
Mar 12, 2012
Messages
19
I have googled this and found the technical answer. My problem is modifying the canned text answe r(it seems to be exactly the same on each reply I've found).

I have D10:D249. I need to sum D10, D13, D16, D19 (every 3rd row) in cell D250.

HELP is always appreciated. If you can break down the answer in baby talk, so I can understand why it works, all the better!

Thanks in advance.
 
Dear Jonmo1,
I was trying to practise with your suggested formula on my below mentioned dataset.
I could sum the total for all the rows with PA(it is giving correct result of 2400) but the sum of all the rows with FT is yielding 0.
Pls let me know where am I going wrong in the 1st Formula?
Could you help in tweaking this pls?
Excel Workbook
FGH
1MonthTypeValue
2JanuaryFT100
3JanuaryPA150
4FebruaryFT200
5FebruaryPA250
6MarchFT300
7MarchPA350
8AprilFT400
9AprilPA450
10MayFT500
11MayPA550
12JuneFT600
13JunePA650
14FT-Total0
15PA-Total2400
14
 
Upvote 0

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
These formulas work excellently, but...

I have an issue in a column where there are some cells with text. I don't know how to avoid the errors of multiplying boolean values and text and the formula ends with #VALUE error. Any suggestions?
 
Upvote 0
These formulas work excellently, but...

I have an issue in a column where there are some cells with text. I don't know how to avoid the errors of multiplying boolean values and text and the formula ends with #VALUE error. Any suggestions?

Would you post the formula?
 
Upvote 0
Any of the =sumproduct(...) formulas have the same issue. If you can fix the last one =SUMPRODUCT($D$10:$D$249*(MOD(ROW($D$10:$D$249)-ROW($D$10),3)=0)) I'll be able to use it in my specific case. Thanks for the reply
 
Upvote 0
Any of the =sumproduct(...) formulas have the same issue. If you can fix the last one =SUMPRODUCT($D$10:$D$249*(MOD(ROW($D$10:$D$249)-ROW($D$10),3)=0)) I'll be able to use it in my specific case. Thanks for the reply

Try...

=SUMPRODUCT($D$10:$D$249,--(MOD(ROW($D$10:$D$249)-ROW($D$10),3)=0)))

Explanation: The comma syntax ignores text values in the sum range, the star syntax does not
.
 
Upvote 0
Try...

=SUMPRODUCT($D$10:$D$249,--(MOD(ROW($D$10:$D$249)-ROW($D$10),3)=0)))

Explanation: The comma syntax ignores text values in the sum range, the star syntax does not
.

This works excelent. Can you explain what does -- stands for? I've noticed it in other posts and formulas but I don't understand it. Thank you very vrey much :)
 
Upvote 0
This works excelent. Can you explain what does -- stands for? I've noticed it in other posts and formulas but I don't understand it.

SumProduct works on numbers. When we have TRUE/FALSE evaluations (the MOD bit subjected to a equality test would yield such), we need to turn them into numbers. The -- bit makes TRUE's 1's and FALSE's 0's. We call -- a coercer; another is +0.

See also:
http://www.mrexcel.com/forum/excel-questions/202204-find-last-cell-data-formular.html
http://www.mrexcel.com/forum/excel-questions/70547-count-function.html#post337954

Thank you very vrey much :smile:

You are welcome.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top