Let's say you have a list of employees by start date and department. You want to create an ARRAYFORMULA to calculate the total salary cost by month for each department like in this sheet. The months will go out for several years so want to use ARRAYFORMULA.
Looking for an ARRAYFORMULA for G2 that will handle the calculation for row 2 which is the Sales department for all months. That formula can then be replicated in G3 and G4 to handle the other departments.
You can't use SUMIFS or QUERY inside ARRAYFORMULA. Since you need to use less than with dates to calculate the total you can't use SUMIF with composite keys. I tried using a FILTER inside SUMIF's inside ARRAYFORMULA but doesn't look like you can use FILTER inside a SUMIF.
Any suggesting for creating an ARRAYFORMULA function to handle this that's still condense enough to manage?







