You can search for both departments and single users.
1: Search for departments
2: Search for users
3: Click on the folder symbol to expand the search to include underlying departments (in the folder hierarchy)
4: You can include archived users in the search by turning ON Archived
5. Download users overview to Excel