Averaging every third column based on a criteria in each preceding column

Peter Davison

Active Member
Joined
Jun 4, 2020
Messages
451
Office Version
  1. 365
Platform
  1. Windows
In Row 5 I have a range in columns BC to CJ which have a value in the following cells BF, BI, BL, BO, BR, BU, BX, CA, CD, CG, CJ
In the columns preceding each of the columns (BE, BH, BK, BN, BQ, BT, BW, BZ, CC, CF, CI) I have a number 1 through to 10 (this number can be repeated in any of the columns)
I have the numbers 1 to 10 as a header in Row 4 columns EA to EJ
Under each respective number I want to get the average of the numbers in BF, BI, BL, BO, BR, BU, BX, CA, CD, CG, CJ but only if the number in the preceding columns matches the number in the column I have the formula in.

I've got to this stage with - =SUMPRODUCT(--(MOD(COLUMN(BD5:CJ5)-COLUMN(BD5)+1,3)=0),BD5:CJ5) which gives me a sum but I can't work out how to get the average and based on the criteria above.

I'm hoping I've explained it ok.
As always any help would be most appreciated.
Regards
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
How about
Excel Formula:
=AVERAGE(FILTER($BF5:$CJ5,($BE5:$CI5=EA$4)*(MOD(COLUMN(BF5:CJ5),3)=1),0))
 
Upvote 0
Solution
That is brilliant.
You are so helpful and amazing.
Really appreciate your help.
Its saved me so much time.
Thank you
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,194
Members
453,021
Latest member
pingpong7117

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