Trying to find the average of multiple matched values

dch09

New Member
Joined
Aug 7, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi,

Firstly - apologies for the awful explanation that is about to come your way. Please ask me some questions if you need to.

1723060542655.png


I am looking for a formula that goes into I1 - that looks at the students name, matches to a row on this next sheet.

1723060647957.png


then finds all the tests that have the spec reference of 1.1.1 (A5), and finds the average of those numbers (5, 3, 5 and 8)

This is what i have so far...
=AVERAGE(VLOOKUP(B1,'Y12 DQ'!B4:BX52,{17,19,23},FALSE))

But i have to input the columns myself (17,19 and 23) as I complete more tests against that spec the average wont change. I've tried messing around with filtering but I am not that excel savy.

Could someone please help me fix this :)

Thanks
Dom
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Hello, could you please test this:

Excel Formula:
=MAP(A5:A10,LAMBDA(a,IFERROR(AVERAGE(FILTER(FILTER('Y12 DQ'!$C$4:$BX$52,'Y12 DQ'!$B$4:$B$52=$B$1),'Y12 DQ'!$C$3:$BX$3=a)),"")))
 
Upvote 0
Solution
Hello, could you please test this:

Excel Formula:
=MAP(A5:A10,LAMBDA(a,IFERROR(AVERAGE(FILTER(FILTER('Y12 DQ'!$C$4:$BX$52,'Y12 DQ'!$B$4:$B$52=$B$1),'Y12 DQ'!$C$3:$BX$3=a)),"")))

Hi Hagia_Sofia,

Thank you so much! Works a treat. If you can - could you let me know exactly what this function/formula is doing so i can attempt to decipher it. I have not seen map and lambda before.

Thanks again.
Dom
 
Upvote 0
Hello, that is good to hear. What MAP + LAMBDA do here is basically to apply the relevant calculation (IFERROR...) to each row of the array (A5:A10); so, "a" represents each element of that array. As a result, instead of copying the formulace to every row separately, it returns a spilled array.
 
Upvote 1

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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