
Hi,
See the screenshot above and apply formula in cell F1. This formula gives to you average for workers for HR and IT departments (both departments). I have used also SORT function to sort Department, Name and Join Date.
=SORT(GROUPBY(A1:C6, D1:D6, AVERAGE, 3, 0,, (B1:B6 = "HR") + (B1:B6 = "IT")), {2,1,3})
In case you want result only for one department (let say HR department) then use this formula:
=GROUPBY(A1:C6, D1:D6, AVERAGE, 3, 0,, (B1:B6 = "HR"))
Change HR in formula with IT in case you want result for IT department and so on.
Hope this helps.