Can you share what your table looks like? shift-command-4, drag to select area, release, start new message here, and use the mountains-and-moon 'Image insertion' icon to insert the screenshot image from the Desktop.
If your table is well formed you will have many options to extract summary data by category and time period.
SUMIFS and AVERAGEIFS can work. However, if you are summarizing by time frame (year, month, etc) you will find that the built-in Category and Pivot Tables functionality in Numbers much easier.
For example, if your table looks something like this:

Then in less than 30 seconds or so you can produce this:
(Organize > Create Pivot Table > On Current sheet in the menu, and in Pivot Options panel that appears to the right drag Date to the Rows box and Expense to the Values box and click the circled I to switch from Sum to Average.)

Or in a second or two switch that to this:

Or, by selecting Add Category for Date in the dropdown by the column letter at the top, you can do something like this:

Neither of these approaches require you to enter and debug a single formula. Just click and drag. Very powerful and flexible, and, as I say, particularly convenient if you are aggregating by time period (lots of choices, including: year, quarter, month, week). It's possible to accomplish the same thing with AVERAGEIFS but that's a lot more work.
I tend to prefer Pivot Tables because they leave the original data table and are more compact.
Have a look at the 'Pivot Tables Basics' template at File > New in your menu for a working example. There's also a 'Categories' template there.
Also see these and other entries in the User Guide (also available via Help > Numbers Help in your menu).
Intro to pivot tables in Numbers on Mac - Apple Support
Create a pivot table in Numbers on Mac - Apple Support
Intro to categories in Numbers on Mac - Apple Support
SG