Spreadsheet: 859557d1707910056-inserting-subtotal-n-total-to-array-formula-subtotal-n-totel
Sheet: What i do

Type | Subtype | Account Code | Description | 2023-04-30 00:00:00 | 2023-05-31 00:00:00 | 2023-06-30 00:00:00 | 2023-07-31 00:00:00 | 2023-08-31 00:00:00 | 2023-09-30 00:00:00 | 2023-10-31 00:00:00 | 2023-11-30 00:00:00 | 2023-12-31 00:00:00 | 2024-01-31 00:00:00 | 2024-02-29 00:00:00 | 2024-03-31 00:00:00
 | Sales | #1 | Sales-Toy | 5150 | 4800 | 4800 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
Revenue | Sales | #2 | Sales-Furniture | 15800 | 15000 | 15500 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
Revenue | Sales | #3 | Sales-Hardware | 39000 | 32100 | 7000 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
Revenue | F&B | #4 | Sales-F&B | 6905 | 8500 | 6500 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
Expenses | [NAME] | #5 | COGS-Hardware | -26800 | -30000 | -30000 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
Expenses | [NAME] | #6 | COGS-Furniture | -8700 | -9000 | -7900 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
Expenses | [NAME] | #7 | COGS-F&B | -1500 | -1500 | -1500 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
Expenses | Staff Cost | #8 | Salary | -3150 | -3150 | -4800 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
Expenses | Staff Cost | #9 | Allowance | -900 | -650 | -1500 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
Expenses | Staff Cost | #10 | Medical Fee | -150 | -150 | -150 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
Expenses | Misc | #11 | Depreciation | -480 | -480 | -480 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
Expenses | Misc | #12 | Utilities | -1100 | -1300 | -1000 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
Expenses | Misc | #13 | Site Maintenance | -2100 | -2100 | -3200 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
Hi, above is what I had done, but I am kind of stuck, I am not able to give it a Subtotal like below. Can it done using formula?
Type | Subtype | Account Code | Description | 2023-04-30 00:00:00 | 2023-05-31 00:00:00 | 2023-06-30 00:00:00 | 2023-07-31 00:00:00 | 2023-08-31 00:00:00 | 2023-09-30 00:00:00 | 2023-10-31 00:00:00 | 2023-11-30 00:00:00 | 2023-12-31 00:00:00 | 2024-01-31 00:00:00 | 2024-02-29 00:00:00 | 2024-03-31 00:00:00
Revenue | Sales | #1 | Sales-Toy | 5150 | 4800 | 4800 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
Revenue | Sales | #2 | Sales-Furniture | 15800 | 15000 | 15500 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
Revenue | Sales | #3 | Sales-Hardware | 39000 | 32100 | 7000 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
 |  |  | Subtotal Sales
Revenue | F&B | #4 | Sales-F&B | 6905 | 8500 | 6500 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
 |  |  | Subtotal F&B
 |  |  | Total Revenue
Expenses | [NAME] | #5 | COGS-Hardware | -26800 | -30000 | -30000 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
Expenses | [NAME] | #6 | COGS-Furniture | -8700 | -9000 | -7900 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
Expenses | [NAME] | #7 | COGS-F&B | -1500 | -1500 | -1500 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
 |  |  | Subtotal COGS
Expenses | Staff Cost | #8 | Salary | -3150 | -3150 | -4800 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
Expenses | Staff Cost | #9 | Allowance | -900 | -650 | -1500 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
Expenses | Staff Cost | #10 | Medical Fee | -150 | -150 | -150 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
 |  |  | Subtotal Staff Cost
Expenses | Misc | #11 | Depreciation | -480 | -480 | -480 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
Expenses | Misc | #12 | Utilities | -1100 | -1300 | -1000 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
Expenses | Misc | #13 | Site Maintenance | -2100 | -2100 | -3200 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
 |  |  | [NAME]
 |  |  | Total Expenses
 |  |  | Total Net Profit