Array Formula for Nth Column Average .. can any one see my error?

Kbester

New Member
Joined
Jun 10, 2017
Messages
2
=SUM(IF(MOD(COLUMN(B2:I2),2)=2)B2:I2)=SUM(IF(MOD(COLUMN(B2:I2),2)=2)B2:I2)

=AVERAGE (IF(MOD(COLUMN('RAW DATA ENTRY'!C4:'RAW DATA ENTRY'!Z4),7)=0 )'RAW DATA ENTRY'!C4:'RAW DATA ENTRY'!Z4)

Can Anyone help me? I am trying to work out average and sum of every 2 or 7 columns. I'm pretty new to array formulas and this complexity and excel. Can anyone see where I am going wrong?

Thanks

Kath
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
=SUM(IF(MOD(COLUMN(B2:I2),2)=2)B2:I2)=SUM(IF(MOD(COLUMN(B2:I2),2)=2)B2:I2)
Kath

Hi Kath

Welcome to the MrExcel forum.

Just to get you started on the SUM.
Fyi MOD(COLUMN(B2:I2),2) can only have two results 0 and 1.

In my example below I have shown you how to sum even columns and odd columns in your range :-
Excel Workbook
BCDEFGHIJ
21234567820
316
Kbester
Excel 2007
Cell Formulas
RangeFormula
J2=SUMPRODUCT(--(MOD(COLUMN(B2:I2),2))*(B2:I2))
J3=SUMPRODUCT(--(MOD(COLUMN(B2:I2),2)=0)*(B2:I2))


hth
 
Upvote 0
=SUMPRODUCT(--(MOD(COLUMN(B2:I2)-COLUMN(B2),2)=0),B2:I2)

This sums every second number in B2:I2.

Control+shift+enter, not just enter:

=AVERAGE (IF(MOD(COLUMN('RAW DATA ENTRY'!C4:Z4)-COLUMN('RAW DATA ENTRY'!C4),7)=0,'RAW DATA ENTRY'!C4:Z4)))

This averages numbers of every seventh column.
 
Upvote 0
In order to avoid including the empty cells in the average, control+shift+enter, not just enter:

Control+shift+enter:

=AVERAGE(IF(MOD(COLUMN('RAW DATA ENTRY'!C4:Z4)-COLUMN('RAW DATA ENTRY'!C4),7)=0,IF(ISNUMBER('RAW DATA ENTRY'!C4:Z4),'RAW DATA ENTRY'!C4:Z4)))
<strike></strike>
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,636
Latest member
laura12345

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