Spreadsheet: 819061d1677204023-formula-to-grouping-data-subtotal-each-depart-and-grand-total
Sheet: Sheet1

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