Kurpal:

Steve's suggestion of using a Department mask is the best approach given your example where the 3 Departments all end with "1" (and assuming that there there is no Department 51, 61 etc).

If the Departments are more random, there is an alternative to the approach of hard-coding a statement and then hiding columns. You list the Departments you want in a single cell in the statement (i.e. "-21,-31,-41"). Then the RNGMERGE() function will refer to that cell, use those Departments and combine them with the GL accounts specified in column B. For an example, look at the statement "DeptRngMerge" in GL sample data.

It still involves hard-coding a statement, but once you figure out the approach, it's easier to maintain (ie. adding a new Department etc).
_________________________
Bruce Gardner
ARX Business Solutions Inc.