Hi,
this is possible, but how depends a little on how your department code is retained in the G/L entries.
A. Global dimension 1 or 2 - easiest. You can build the account schedule on the g/l entries.
B. Some other dimension: You need to define an analysis view for the department code first. The analysis view can contain up to 4 dimensions. It can be updated in real-time (at every post), but this will come with a performance hit for all posting transactions. You can build the account schedule on the analysis view.
C. Extra field in the G/L entries (nothing is impossible ;): You need to customize the account schedule functionality accordingly before you can use it.
Assuming that you have a good setup and your column layout line contains a field called "Department Totaling" (either being one of the dimension totaling fields, or an aditional one), you can place your totalings for the departments there. Column E is a formula and adds up columns B..C. This should be the same for all three variants.
with best regards
Jens