Formula for adding cells (with a row interval)

Jojo86

New Member
Joined
Jul 24, 2023
Messages
9
Office Version
  1. 365
Platform
  1. Windows
Hi,

Some months ago I had a similar question and it was solved here: Formula for adding cells (with a 5 row interval)
using this formula: =SUM(IF(MOD(ROW('21 SUP'!A15:A100),5)=0,'21 SUP'!A15:A100,0))

My question this time is this:

I have a lot of columns and in each column I have to add several cells (with a 1 row interval and a 4 row internal):

Example:
Column A1 ='21 SUP'!A1+'21 SUP'!A5+'21 SUP'!A6+'21 SUP'!A10+'21 SUP'!A11+'21 SUP'!A15+'21 SUP'!A16 etc
Column B1 ='21 SUP'!B1+'21 SUP'!B5+'21 SUP'!B6+'21 SUP'!B10+'21 SUP'!B11+'21 SUP'!B15+'21 SUP'!B16 etc

-> Can you please give me a formula I can use that can be used in different columns?

Thanks everyone
 
As per my earlier suggestion:
Book1
ABC
1Jun-22Jul-22
221 SUP37229
331 CMSW7069
Help
Cell Formulas
RangeFormula
B2:C2B2=SUM(IF(MOD(ROW('21 SUP'!X10:X100),5)={1,2},'21 SUP'!X10:X100,0))
B3:C3B3=SUM(IF(MOD(ROW('31 CMSW'!X10:X100),5)={1,2},'31 CMSW'!X10:X100,0))
 
Upvote 0
I pasted it. And had to change 3 of the , to ; and I get 0 as a result

Mr.Excel (2).xlsx
ABC
1June 2022July 2022
221 SUP00
331 CMSW00
Help
Cell Formulas
RangeFormula
B2:C2B2=SUM(IF(MOD(ROW('21 SUP'!X10:X100),5)={1.2},'21 SUP'!X10:X100,0))
B3:C3B3=SUM(IF(MOD(ROW('31 CMSW'!X10:X100),5)={1.2},'31 CMSW'!X10:X100,0))


And this shows the formula i have as when i pasted the above {1,2} is showing as {1.2}

1697633139963.png
 
Upvote 0
Hei,

I changed all 4 , to ; and got N/A error.

HOWEVER your new formula (below) Peter worked. Thanks :)
RangeFormula
Cell Formulas
B2:C2B2=LET(r,'21 SUP'!X11:X77,s,MOD(SEQUENCE(ROWS(r)),5),SUM(FILTER(r,(s=1)+(s=2))))
B3:C3B3=LET(r,'31 CMSW'!X11:X77,s,MOD(SEQUENCE(ROWS(r)),5),SUM(FILTER(r,(s=1)+(s=2))))

I didn't think about the Row Labels (i'm not good in excel). The first one is Subcontractors and the other is Travel. If you would like to share that in a formula too that would be great :) Thanks.
 
Upvote 0
You're very welcome. Thanks for the confirmation. :)
 
Upvote 0

Forum statistics

Threads
1,216,116
Messages
6,128,932
Members
449,480
Latest member
yesitisasport

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