Share via

AVERAGEIFS and Structured Table References

Anonymous
2021-06-21T17:29:22+00:00

Hi

I am having some difficulty getting structured references correct in the Excel TABLE shown below. For each row, the column AvgAmount should show the average of the Amount field for all rows with the same category and whose Date is equal to or less than than the date in the current row.

In this example, dates are DDMMYYYY and AvgAmount has been determined manually to reflect the answer I expect by formula. And, it cannot be assumed that records will be or will remain in chronological order.

Can anyone help with the formula I should be using in column D please?

Thanks

A B C D
1 Date Category Amount AvgAmount
2 15/01/2021 A 10 10
3 02/02/2021 A 20 15
4 05/03/2021 B 5 5
5 31/03/2021 A 30 20
Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

HansV 462.6K Reputation points
2021-06-21T18:02:37+00:00

In D2:

=AVERAGEIFS([Amount],[Category],[@Category],[Date],"<="&[@Date])

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2021-06-21T18:09:59+00:00

    Perfect!

    Thank you Hans.

    Was this answer helpful?

    0 comments No comments