Totaling Question Using Sum(IF

jkktx81

Board Regular
Joined
Jan 25, 2008
Messages
154
I am familier with using this type of formula to add columns if the criteria matches such as:
{=SUM(IF('2009LP'!$C$2:'2009LP'!$C$6999="JAN",IF('2009LP'!$D$2:'2009LP'!$D$6999="LP483",'2009LP'!$J$2:'2009LP'!$J$6999,0)))}

It works good for me if adding data from another main entry sheet onto a totaling sheet.

My question: If I want to use the sumif to add data from say coulmn C, but it's only every 4th cell, like C4, C8, C12, C16, C20 so on and so on, is there way to put that in the formula? Because data in the other cells I don't want to add...
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
I am familier with using this type of formula to add columns if the criteria matches such as:
{=SUM(IF('2009LP'!$C$2:'2009LP'!$C$6999="JAN",IF('2009LP'!$D$2:'2009LP'!$D$6999="LP483",'2009LP'!$J$2:'2009LP'!$J$6999,0)))}

It works good for me if adding data from another main entry sheet onto a totaling sheet.

My question: If I want to use the sumif to add data from say coulmn C, but it's only every 4th cell, like C4, C8, C12, C16, C20 so on and so on, is there way to put that in the formula? Because data in the other cells I don't want to add...
Like this...

Book1
C
339
46
560
657
736
883
999
1061
1112
1248
1379
1433
1541
1639
1724
1822
1968
2051
2157
Sheet1

If you know for certain that you will never insert new rows before the start of the range then use this version:

=SUMPRODUCT(--(MOD(ROW(C4:C20),4)=0),C4:C20)

If you might insert new rows before the start of the range then use this version:

=SUMPRODUCT(--(MOD(ROW(C4:C20)-ROW(C4),4)=0),C4:C20)
 
Upvote 0
Thanks; I do need to use the sumif I believe, because I only want to add those cells IF data matches criteria in another column. Will the sumproduct work the same way?
 
Upvote 0
I am familier with using this type of formula to add columns if the criteria matches such as:
{=SUM(IF('2009LP'!$C$2:'2009LP'!$C$6999="JAN",IF('2009LP'!$D$2:'2009LP'!$D$6999="LP483",'2009LP'!$J$2:'2009LP'!$J$6999,0)))}

It works good for me if adding data from another main entry sheet onto a totaling sheet.

My question: If I want to use the sumif to add data from say coulmn C, but it's only every 4th cell, like C4, C8, C12, C16, C20 so on and so on, is there way to put that in the formula? Because data in the other cells I don't want to add...

Generic formula...

Control+shift+enter, not just enter:

=SUM(IF(MOD(ROW(C2:C2000)-ROW(C2),N)=0,C2:C2000))

where N can take on values like 2, 3, 4, etc. This makes the summing start with the first cell of the range of interest.
 
Upvote 0
Thanks; I do need to use the sumif I believe, because I only want to add those cells IF data matches criteria in another column. Will the sumproduct work the same way?
Yes

Book1
BC
3A39
4V6
5C60
6C57
7V36
8XXX83
9F99
10G61
11H12
12XXX48
13G79
14H33
15N41
16J39
17XXX24
18H22
19H68
20X51
21V57
Sheet1

Sum every 4th cell in column C starting from cell C4 when the corresponding cell in column B = XXX

=SUMPRODUCT(--(B4:B20="XXX"),--(MOD(ROW(C4:C20),4)=0),C4:C20)

=SUMPRODUCT(--(B4:B20="XXX"),--(MOD(ROW(C4:C20)-ROW(C4),4)=0),C4:C20)
 
Upvote 0
Once again for the help: But I'm still having trouble, let me be more specific because I'm probably not explaining well enough or I just doing something wrong. Here is actually what I'm trying to do:

Sheet names: DISP & DRVST

In DRVST: Need formula in D3 that totals from DISP column C4:C72 and thats only every 4th cell such as C4, C8, C12, C16 all the way to C72,

BUT only if DISP column E, in every 4th cell such as E5, E9, E13, E7 ALL THE WAY TO E73 has PGEK in the the cell.
 
Upvote 0
Once again for the help: But I'm still having trouble, let me be more specific because I'm probably not explaining well enough or I just doing something wrong. Here is actually what I'm trying to do:

Sheet names: DISP & DRVST

In DRVST: Need formula in D3 that totals from DISP column C4:C72 and thats only every 4th cell such as C4, C8, C12, C16 all the way to C72,

BUT only if DISP column E, in every 4th cell such as E5, E9, E13, E7 ALL THE WAY TO E73 has PGEK in the the cell.
Ok, still the same technique, it's just that your ranges are offset from each other.

=SUMPRODUCT(--(DISP!E5:E73="PGEK"),--(MOD(ROW(DISP!C4:C72),4)=0),DISP!C4:C72)

=SUMPRODUCT(--(DISP!E5:E73="PGEK"),--(MOD(ROW(DISP!C4:C72)-ROW(DISP!C4),4)=0),DISP!C4:C72)
 
Upvote 0
Tried this and didn't work:
=SUMPRODUCT(--(DISP!E5:!E73="PGEK"),--(MOD(ROW(DISP!C4:C20),4)=0),C4:C20))
 
Upvote 0

Forum statistics

Threads
1,224,591
Messages
6,179,768
Members
452,940
Latest member
rootytrip

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