Spreadsheet: 717566d1612741943-adding-subtotal-function-to-a-sumifs-formula-subtotal-sumifs-sample
Sheet: ONP PUTS Only

 |  |  |  |  |  | 2020-11-06 00:00:00 | Last | Symbols | Positions | Unr. P/L | Real. P/L
 |  |  |  |  |  |  |  |  |  |  |  |  | I would Like the yellow Highlited cell To Provide filtered totals calculaded by the cell formula whenever any of filters are applied.
 |  |  |  |  |  |  |  |  |  |  |  |  | For instance if I apply "Exec. Time" Filter to Agust, and Symbol Filter to NLY ,the result should Be:
 |  |  |  |  |  |  |  |  |  |  |  |  | NLY Position = 12 (all The Sell minus all EXP & STK Asgmt)
 |  |  |  |  |  |  |  |  |  |  |  |  | NLY Unr.P/L = 1334.85 (cash Flow total minus Real P/L)
 |  |  |  |  |  |  |  |  |  |  |  |  | NLY Real P/L = 459.30
 |  |  |  |  |  |  |  |  |  |  |  |  | Keeping in Mind that the realized P/L materializes once the "EXP Date" becomes older than Today
 |  |  |  |  |  |  |  |  |  |  |  |  | For this Sample I Just placed an older date in Cell G1, orelse if I Use function Today() All the listed trades would become realized P/L
 |  |  |  | OPRA Code | Exec Time | EXP Date | Type | Side | Symbol | QTY | Strike | Price | Comm | Fees | Stock Split | [NAME] | Credit | Cash Flow | Real. P/L | Mark Val & Unr. P/L | Maint/Marg Req.
 |  |  |  |  | 2020-03-19 00:00:00
 |  |  |  |  | 2020-06-09 00:00:00 | 2021-01-15 00:00:00 | PUT | SELL | NLY | 1 | 7 | 1.06 | -0.6890000000000001 | -0.04
 |  |  |  |  | 2020-06-09 00:00:00 | 2021-01-15 00:00:00 | PUT | BUY | NLY | 1 | 7 | 0.04 | -0.6890000000000001 | -0.03
 |  |  |  |  | 2020-07-01 00:00:00 | 2020-07-02 00:00:00 | PUT | STK ASGMT | NLY | 5 | 7 | 0 | 0 | 0
 |  |  |  |  | 2020-07-09 00:00:00 | 2020-07-10 00:00:00 | PUT | STK ASGMT | NLY | 2 | 7 | 0 | 0 | 0
 |  |  |  |  | 2020-07-11 00:00:00 | 2020-07-10 00:00:00 | PUT | STK ASGMT | NLY | 3 | 7 | 0 | 0 | 0
 |  |  |  |  | 2020-07-14 00:00:00 | 2021-01-15 00:00:00 | PUT | SELL | AGNC | 5 | 12 | 1.17 | -0.7605 | -0.1
 |  |  |  |  | 2020-07-16 00:00:00 | 2021-01-15 00:00:00 | PUT | SELL | AGNC | 5 | 13 | 1.65 | -1.0725 | -0.11
 |  |  |  |  | 2020-07-16 00:00:00 | 2021-01-15 00:00:00 | PUT | SELL | NLY | 5 | 6 | 0.47 | -0.3055 | -0.1
 |  |  |  |  | 2020-07-16 00:00:00 | 2022-01-21 00:00:00 | PUT | SELL | NLY | 2 | 7 | 1.67 | -1.0855 | -0.04
 |  |  |  |  | 2020-07-16 00:00:00 | 2022-01-21 00:00:00 | PUT | SELL | NLY | 2 | 7 | 1.67 | -1.0855 | -0.04
 |  |  |  |  | 2020-07-16 00:00:00 | 2022-01-21 00:00:00 | PUT | SELL | NLY | 1 | 7 | 1.67 | -1.0855 | -0.03
 |  |  |  |  | 2020-07-18 00:00:00 | 2020-07-17 00:00:00 | PUT | EXP | AGNC | 1 | 12 | 0 | 0 | 0
 |  |  |  |  | 2020-07-21 00:00:00 | 2020-07-17 00:00:00 | PUT | EXP | NLY | 5 | 7 | 0 | 0 | 0
 |  |  |  |  | 2020-07-21 00:00:00 | 2021-01-15 00:00:00 | PUT | SELL | NLY | 3 | 6 | 0.45 | -0.2925 | -0.07
 |  |  |  |  | 2020-07-21 00:00:00 | 2021-01-15 00:00:00 | PUT | SELL | NLY | 2 | 6 | 0.45 | -0.2925 | -0.04
 |  |  |  |  | 2020-07-21 00:00:00 | 2022-01-21 00:00:00 | PUT | SELL | NLY | 5 | 7 | 1.49 | -0.9685 | -0.11
 |  |  |  |  | 2020-07-21 00:00:00 | 2020-08-21 00:00:00 | PUT | SELL | NLY | 5 | 7 | 0.27 | -0.1755 | -0.1
 |  |  |  |  | 2020-07-23 00:00:00 | 2022-01-21 00:00:00 | PUT | SELL | NLY | 1 | 7 | 1.43 | -0.9295 | -0.03
 |  |  |  |  | 2020-07-23 00:00:00 | 2020-10-16 00:00:00 | PUT | SELL | NLY | 1 | 7 | 0.45 | -0.2925 | -0.03
 |  |  |  |  | 2020-07-23 00:00:00 | 2021-01-15 00:00:00 | PUT | SELL | NLY | 1 | 7 | 0.77 | -0.5005000000000001 | -0.03
 |  |  |  |  | 2020-07-23 00:00:00 | 2020-09-18 00:00:00 | PUT | SELL | NLY | 1 | 7 | 0.28 | -0.182 | -0.03
 |  |  |  |  | 2020-07-23 00:00:00 | 2022-01-21 00:00:00 | PUT | SELL | AGNC | 1 | 13 | 2.63 | -1.7095 | -0.03
 |  |  |  |  | 2020-07-23 00:00:00 | 2021-03-19 00:00:00 | PUT | SELL | AGNC | 1 | 13 | 1.46 | -0.949 | -0.03
 |  |  |  |  | 2020-07-30 00:00:00 | 2020-07-24 00:00:00 | PUT | EXP | NLY | 5 | 7 | 0 | 0 | 0
 |  |  |  |  | 2020-08-03 00:00:00 | 2022-01-21 00:00:00 | PUT | SELL | AGNC | 2 | 13 | 2.59 | -1.6835 | -0.04
 |  |  |  |  | 2020-08-14 00:00:00 | 2022-01-21 00:00:00 | PUT | SELL | NLY | 2 | 7 | 1.29 | -0.8385 | -0.04
 |  |  |  |  | 2020-08-14 00:00:00 | 2020-08-28 00:00:00 | PUT | SELL | NLY | 10 | 7.5 | 0.14 | -0.09100000000000001 | -0.2
 |  |  |  |  | 2020-08-25 00:00:00 | 2020-08-21 00:00:00 | PUT | EXP | NLY | 10 | 0 | 0 | 0 | 0
 |  |  |  |  | 2020-08-25 00:00:00 | 2021-04-16 00:00:00 | PUT | SELL | NLY | 10 | 7 | 0.74 | -0.481 | -0.21
 |  |  |  |  | 2020-08-29 00:00:00 | 2020-11-20 00:00:00 | PUT | SELL | NLY | 10 | 7 | 0.32 | -0.208 | -0.2
 |  |  |  |  | 2020-08-29 00:00:00 | 2020-08-21 00:00:00 | PUT | STK ASGMT | NLY | 10 | 7 | 0 | 0 | 0
 |  |  |  |  | 2020-09-18 00:00:00 | 2023-01-20 00:00:00 | PUT | SELL | AGNC | 1 | 15 | 3.8 | -2.47 | -0.03
 |  |  |  |  | 2020-09-18 00:00:00 | 2023-01-20 00:00:00 | PUT | SELL | AGNC | 2 | 12 | 1.91 | -1.2415 | -0.04
 |  |  |  |  | 2020-09-18 00:00:00 | 2023-01-20 00:00:00 | PUT | SELL | AGNC | 1 | 15 | 3.8 | -2.47 | -0.03
 |  |  |  |  | 2020-09-19 00:00:00 | 2022-01-21 00:00:00 | PUT | SELL | AGNC | 3 | 15 | 2.75 | -1.7875 | -0.08
 |  |  |  |  | 2020-09-19 00:00:00 | 2020-09-18 00:00:00 | PUT | EXP | AGNC | 6 | 14 | 0 | 0 | 0
 |  |  |  |  | 2020-09-21 00:00:00 | 2020-09-18 00:00:00 | PUT | EXP | NLY | 1 | 7 | 0 | 0 | 0
 |  |  |  |  | 2020-09-21 00:00:00 | 2023-01-20 00:00:00 | PUT | SELL | NLY | 5 | 10 | 4 | -2.6 | -0.13
 |  |  |  |  | 2020-09-29 00:00:00 | 2020-12-18 00:00:00 | PUT | SELL | NLY | 5 | 8 | 0.94 | -0.611 | -0.1
 |  |  |  |  | 2020-10-06 00:00:00 | 2023-01-20 00:00:00 | PUT | SELL | AGNC | 2 | 15 | 4.2 | -2.73 | -0.05
 |  |  |  |  | 2020-10-15 00:00:00 | 2023-01-20 00:00:00 | PUT | SELL | AGNC | 2 | 12 | 2.38 | -1.547 | -0.04
 |  |  |  |  | 2020-10-17 00:00:00 | 2022-01-21 00:00:00 | PUT | SELL | AGNC | 1 | 15 | 2.8 | -1.82 | -0.02
 |  |  |  |  | 2020-10-21 00:00:00 | 2020-10-15 00:00:00 | PUT | EXP | NLY | 11 | 7 | 0 | 0 | 0
 |  |  |  |  | 2020-10-28 00:00:00 | 2022-01-21 00:00:00 | PUT | SELL | AGNC | 1 | 15 | 3.25 | -2.1125 | -0.02
 |  |  |  |  | 2020-10-29 00:00:00 | 2022-01-21 00:00:00 | PUT | SELL | AGNC | 1 | 15 | 3.15 | -2.0475 | -0.02
 |  |  |  |  | 2020-10-29 00:00:00 | 2023-01-20 00:00:00 | PUT | SELL | NLY | 1 | 10 | 4.25 | -2.7625 | -0.02
 |  |  |  |  | 2020-11-04 00:00:00 | 2023-01-20 00:00:00 | PUT | SELL | AGNC | 1 | 15 | 4.45 | -2.8925 | -0.02
 |  |  |  |  | 2020-11-06 00:00:00 | 2020-12-18 00:00:00 | PUT | BUY | AGNC | 4 | 11 | 0.02 | 0 | -0.06
 |  |  |  |  | 2020-11-06 00:00:00 | 2020-12-18 00:00:00 | PUT | BUY | AGNC | 1 | 11 | 0.02 | 0 | -0.01
 |  |  |  |  | 2020-11-06 00:00:00 | 2020-11-20 00:00:00 | PUT | BUY | NLY | 9 | 7 | 0.04 | 0 | -0.13