Average Function

frdranger25401

New Member
Joined
Feb 6, 2025
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Im scratching my head on a function I have been stumped with for a few days now. I attached a a pic for reference. What im trying to do is type in the search box "H3" that will reference the last 10 entries in column "A" and then it averages the numbers to the right. IE. if I place A1 in the search box at H3, it will reference column A. In my picture example, it will then take B16, B17, B18 and average that number and return the results to another cell. All I have been able to figure out is how to get it to average the last 10 that say A1, which is not what i want it to do. I cant figure how to get it to look at just the last 10 cells regardless of what the text is and just average those 10 cells that have the text A1. Any help would be appreciated.
 

Attachments

  • xcel.jpg
    xcel.jpg
    54.3 KB · Views: 9

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Hi & welcome to MrExcel.
How about
Excel Formula:
=LET(f,TAKE(FILTER(A2:B100,A2:A100<>""),-10),AVERAGE(FILTER(TAKE(f,,-1),TAKE(f,,1)=H3)))
 
Upvote 0
Do you mean to ignore any rows in col B that are blank & not include them as the last 10?
 
Upvote 0
I did not see posts 6 and 7 before posting the following.
With a current version of 365, try the following:

T202502a.xlsm
ABCDE
1A2
2A491
3A6
4A8
5C10A82
6C12B85
7A14C94
8A16
9A18C94
10A20
2b
Cell Formulas
RangeFormula
E2E2=AVERAGE(TAKE(B:.B,H2))
D5:E7D5=LET(a,TAKE(A:.B,-10),GROUPBY(INDEX(a,,1),INDEX(a,,2),AVERAGE,,0))
D9:E9D9=TAKE(LET(a,TAKE(A:.B,-10),GROUPBY(INDEX(a,,1),INDEX(a,,2),AVERAGE,,0)),-1)
B2:B10B2=B1+2
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,226,501
Messages
6,191,394
Members
453,655
Latest member
lasvegasbuffet

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