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

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
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,223,911
Messages
6,175,327
Members
452,635
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