Spreadsheet: 819109d1677218336-formula-to-grouping-data-subtotal-each-depart-and-grand-total-7-
Sheet: Sheet1

 | COMPANY |  | DEPT |  | NAME |  |  |  |  |  |  |  | XYZ. Inc
 | XYZ. Inc |  | EXTERNAL RELATION |  | MARIYONO | EXR | 1
 | ABC. Inc |  | FINANCE & ACCOUNTING |  | NAWIL | GAC | 2
 | XYZ. Inc |  | GENERAL SERVICES |  | WAHYUDIANTO | GA | 3
 | XYZ. Inc |  | HUMAN RESOURCES |  | MUTTAQIN | HRD | 4
 | XYZ. Inc |  | MAINTENANCE & CONSTRUCTION |  | WILSON | MEM | 5
 | XYZ. Inc |  | MINE GEOLOGY & PLANNING |  | FAHRIAL | MPL | 6
 | XYZ. Inc |  | MINE GEOLOGY & PLANNING |  | MOECHAMMAD | MPL | 7
 | XYZ. Inc |  | OPERATION |  | SELAMAT | ODS | 8
 | XYZ. Inc |  | QSE |  | ARAFIK | ENV | 9
 | XYZ. Inc |  | EXTERNAL RELATION |  | NUR QAYIN | EXR | 10
 | XYZ. Inc |  | FINANCE & ACCOUNTING |  | [NAME] | GAC | 11
 | XYZ. Inc |  | GENERAL SERVICES |  | WAHYUDI | GA | 12
 | XYZ. Inc |  | HUMAN RESOURCES |  | [NAME] | HRD | 13
 | XYZ. Inc |  | MAINTENANCE & CONSTRUCTION |  | ARIS | MEM | 14
 | XYZ. Inc |  | MINE GEOLOGY & PLANNING |  | MOHAMAD | MPL | 15
 | ABC. Inc |  | MINE GEOLOGY & PLANNING |  | [NAME] | MPL | 16
 | ABC. Inc |  | OPERATION |  | LIN SLAMET | ODS | 17
 | ABC. Inc |  | QSE |  | BAHAR | ENV | 18
 | ABC. Inc |  | EXTERNAL RELATION |  | AHMAD | EXR | 19
 | ABC. Inc |  | FINANCE & ACCOUNTING |  | ADI PUTRANTO | GAC | 20
 | ABC. Inc |  | GENERAL SERVICES |  | ALFIAN | GA | 21
 | ABC. Inc |  | HUMAN RESOURCES |  | SUGENG | HRD | 22
 | ABC. Inc |  | MAINTENANCE & CONSTRUCTION |  | TRIYANTO | MEM | 23
 | ABC. Inc |  | MINE GEOLOGY & PLANNING |  | IWAN | MPL | 24
 | ABC. Inc |  | OPERATION |  | RISTANTO | ODS | 25
 | ABC. Inc |  | OPERATION |  | ABI HAIR | ODS | 26
 | ABC. Inc |  | QSE |  | ANDI YANTO | ENV | 27
 |  |  |  |  |  |  |  |  |  |  |  |  | XYZ. Inc
 |  |  |  |  |  |  |  |  | EXTERNAL RELATION | AHMAD | ABC. Inc | 19 | EXTERNAL RELATION | MARIYONO | XYZ. Inc | 1
 |  |  |  |  |  |  |  |  | Subtotal |  |  | 1 | EXTERNAL RELATION | NUR QAYIN | XYZ. Inc | 10
 |  |  |  |  |  |  |  |  | FINANCE & ACCOUNTING | NAWIL | ABC. Inc | 2 | Subtotal |  |  | 2
 |  |  |  |  |  |  |  |  | FINANCE & ACCOUNTING | ADI PUTRANTO | ABC. Inc | 20 | FINANCE & ACCOUNTING | [NAME] | XYZ. Inc | 11
 |  |  |  |  |  |  |  |  | Subtotal |  |  | 2 | Subtotal |  |  | 1
 |  |  |  |  |  |  |  |  | GENERAL SERVICES | ALFIAN | ABC. Inc | 21 | GENERAL SERVICES | WAHYUDIANTO | XYZ. Inc | 3
 |  |  |  |  |  |  |  |  | Subtotal |  |  | 1 | GENERAL SERVICES | WAHYUDI | XYZ. Inc | 12
 |  |  |  |  |  |  |  |  | HUMAN RESOURCES | SUGENG | ABC. Inc | 22 | Subtotal |  |  | 2
 |  |  |  |  |  |  |  |  | Subtotal |  |  | 1 | HUMAN RESOURCES | MUTTAQIN | XYZ. Inc | 4
 |  |  |  |  |  |  |  |  | MAINTENANCE & CONSTRUCTION | TRIYANTO | ABC. Inc | 23 | HUMAN RESOURCES | [NAME] | XYZ. Inc | 13
 |  |  |  |  |  |  |  |  | Subtotal |  |  | 1 | Subtotal |  |  | 2
 |  |  |  |  |  |  |  |  | MINE GEOLOGY & PLANNING | [NAME] | ABC. Inc | 16 | MAINTENANCE & CONSTRUCTION | WILSON | XYZ. Inc | 5
 |  |  |  |  |  |  |  |  | MINE GEOLOGY & PLANNING | IWAN | ABC. Inc | 24 | MAINTENANCE & CONSTRUCTION | ARIS | XYZ. Inc | 14
 |  |  |  |  |  |  |  |  | Subtotal |  |  | 2 | Subtotal |  |  | 2
 |  |  |  |  |  |  |  |  | OPERATION | LIN SLAMET | ABC. Inc | 17 | MINE GEOLOGY & PLANNING | FAHRIAL | XYZ. Inc | 6
 |  |  |  |  |  |  |  |  | OPERATION | RISTANTO | ABC. Inc | 25 | MINE GEOLOGY & PLANNING | MOECHAMMAD | XYZ. Inc | 7
 |  |  |  |  |  |  |  |  | OPERATION | ABI HAIR | ABC. Inc | 26 | MINE GEOLOGY & PLANNING | MOHAMAD | XYZ. Inc | 15
 |  |  |  |  |  |  |  |  | Subtotal |  |  | 3 | Subtotal |  |  | 3
 |  |  |  |  |  |  |  |  | QSE | BAHAR | ABC. Inc | 18 | OPERATION | SELAMAT | XYZ. Inc | 8
 |  |  |  |  |  |  |  |  | QSE | ANDI YANTO | ABC. Inc | 27 | Subtotal |  |  | 1
 |  |  |  |  |  |  |  |  | Subtotal |  |  | 2 | QSE | ARAFIK | XYZ. Inc | 9
 |  |  |  |  |  |  |  |  | Grand total |  |  | 260 | Subtotal |  |  | 1
 |  |  |  |  |  |  |  |  |  |  |  |  | Grand total |  |  | 118
 |  |  |  |  |  |  |  |  |  |  |  |  | Overall |  |  | 378