Welcome to the forum.
With the date 01/03/2024 in P1, try this in M2:
=LET(u,UNIQUE(A2:B21),f,FILTER(u,(INDEX(u,,2)>=P1)*(INDEX(u,,2)<EDATE(P1,1))),AVERAGE(MAP(INDEX(f,,1),INDEX(f,,2),LAMBDA(i,d,SUMPRODUCT((A2:A21=i)*(B2:B21=d)*J2:J21)))))
Does it produce your expected result? If not, what should the expected result be?
Bookmarks