I am finding it challenging to nest AND/OR criteria in my SUM/INDEX/MATCH function. My end goal is, for each hour ending "HE" of each day "DAY" sum all the values across the index that meet the following logical criteria
ROWS:
AND( (Start Date is <= DAY, End Date is >= DAY), OR(PROD = 7x24, PROD = 7x8, PROD = 2x8), Hedge zone = 'ERCT-N')
COLUMN:
HE = Index HE
Below is my code and my formula is in cell BA3 and looks like this:
=SUM(INDEX(U3:AR26,MATCH(1,(J3:J26<=AV3)*(K3:K26>=AV3)*((L3:L26="7x24")+(L3:L26="7x8")+(L3:L26="2x8"))*(N3:N26="ERCT-N"),0),MATCH(AZ3,U2:AR2,0)))
Here's the odd thing, when I reduce my formula I get a zero value when I should get a value of 8
=SUM(INDEX(U3:AR26,MATCH(1,((L3:L26="7x24")+(L3:L26="7x8")+(L3:L26="2x8")),0),MATCH(AZ3,U2:AR2,0)))
ROWS:
AND( (Start Date is <= DAY, End Date is >= DAY), OR(PROD = 7x24, PROD = 7x8, PROD = 2x8), Hedge zone = 'ERCT-N')
COLUMN:
HE = Index HE
Below is my code and my formula is in cell BA3 and looks like this:
=SUM(INDEX(U3:AR26,MATCH(1,(J3:J26<=AV3)*(K3:K26>=AV3)*((L3:L26="7x24")+(L3:L26="7x8")+(L3:L26="2x8"))*(N3:N26="ERCT-N"),0),MATCH(AZ3,U2:AR2,0)))
Here's the odd thing, when I reduce my formula I get a zero value when I should get a value of 8
=SUM(INDEX(U3:AR26,MATCH(1,((L3:L26="7x24")+(L3:L26="7x8")+(L3:L26="2x8")),0),MATCH(AZ3,U2:AR2,0)))
Executive Dashboard.xlsm | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | AA | AB | AC | AD | AE | AF | AG | AH | AI | AJ | AK | AL | AM | AN | AO | AP | AQ | AR | AS | AT | AU | AV | AW | AX | AY | AZ | BA | BB | BC | BD | BE | |||
2 | TYPE | INDEX | SELL | CP | TRADER | DATE | START | END | PROD | ZONE | ZONE | QTY | PRC | ENTERED | MODIFIED | (MWH) | (MWH) | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | Day | Peak | Date | Month | Day | HE | ERCT-N | ERCT-S | ERCT-W | ERCT-H | ERCT-ALL | |||||||
3 | Physical | RealTimeMarket | Buy | - | 7/1/2021 | 7/31/2021 | 7x24 | ERCOT_N | ERCT-N | - | - | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | WD | OFF | 12/01/2020 | Dec 2020 | Dec | 1 | 1 | #N/A | ||||||||||||||||
4 | Physical | RealTimeMarket | Sell | - | 11/1/2020 | 11/30/2020 | 7x24 | ERCOT_N | ERCT-N | - | - | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | WD | OFF | 12/01/2020 | Dec 2020 | Dec | 1 | 2 | |||||||||||||||||
5 | Physical | RealTimeMarket | Sell | - | 11/1/2020 | 4/30/2021 | 7x8 | ERCOT_N | ERCT-N | - | - | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | WD | OFF | 12/01/2020 | Dec 2020 | Dec | 1 | 3 | |||||||||||||||||
6 | Physical | RealTimeMarket | Sell | - | 11/1/2020 | 4/30/2021 | 7x16 | ERCOT_N | ERCT-N | - | - | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | WD | OFF | 12/01/2020 | Dec 2020 | Dec | 1 | 4 | |||||||||||||||||
7 | Physical | RealTimeMarket | Sell | - | 11/1/2020 | 1/31/2021 | 5x16 | ERCOT_N | ERCT-N | - | - | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | WD | OFF | 12/01/2020 | Dec 2020 | Dec | 1 | 5 | |||||||||||||||||
8 | Physical | RealTimeMarket | Sell | - | 11/1/2020 | 8/31/2021 | 2x16 | ERCOT_N | ERCT-N | - | - | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | WD | OFF | 12/01/2020 | Dec 2020 | Dec | 1 | 6 | |||||||||||||||||
9 | Physical | RealTimeMarket | Buy | 6/17/2020 | 7/1/2020 | 6/30/2022 | 7x16 | ERCOT_H | ERCT-H | 6/17/2020 | 6/17/2020 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 0.0 | 0.0 | WD | OFF | 12/01/2020 | Dec 2020 | Dec | 1 | 7 | |||||||||||||||||
10 | Physical | RealTimeMarket | Buy | 6/17/2020 | 8/1/2020 | 7/31/2023 | 7x16 | ERCOT_H | ERCT-H | 6/17/2020 | 6/17/2020 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 2.0 | 2.0 | 2.0 | 2.0 | 2.0 | 2.0 | 2.0 | 2.0 | 2.0 | 2.0 | 2.0 | 2.0 | 2.0 | 2.0 | 2.0 | 2.0 | 0.0 | 0.0 | WD | OFF | 12/01/2020 | Dec 2020 | Dec | 1 | 8 | |||||||||||||||||
11 | Physical | RealTimeMarket | Buy | 6/24/2020 | 9/1/2020 | 9/30/2020 | 7x16 | ERCOT_H | ERCT-H | 6/24/2020 | 6/24/2020 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 4.0 | 4.0 | 4.0 | 4.0 | 4.0 | 4.0 | 4.0 | 4.0 | 4.0 | 4.0 | 4.0 | 4.0 | 4.0 | 4.0 | 4.0 | 4.0 | 0.0 | 0.0 | WD | OFF | 12/01/2020 | Dec 2020 | Dec | 1 | 9 | |||||||||||||||||
12 | Physical | RealTimeMarket | Buy | 6/24/2020 | 9/1/2020 | 9/30/2020 | 7x8 | ERCOT_H | ERCT-H | 6/24/2020 | 6/24/2020 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.5 | 1.5 | WD | OFF | 12/01/2020 | Dec 2020 | Dec | 1 | 10 | |||||||||||||||||
13 | Physical | RealTimeMarket | Buy | 6/24/2020 | 10/1/2020 | 10/31/2020 | 7x16 | ERCOT_H | ERCT-H | 6/24/2020 | 6/24/2020 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 2.0 | 2.0 | 2.0 | 2.0 | 2.0 | 2.0 | 2.0 | 2.0 | 2.0 | 2.0 | 2.0 | 2.0 | 2.0 | 2.0 | 2.0 | 2.0 | 0.0 | 0.0 | WD | OFF | 12/01/2020 | Dec 2020 | Dec | 1 | 11 | |||||||||||||||||
14 | Physical | RealTimeMarket | Buy | 6/24/2020 | 10/1/2020 | 10/31/2020 | 7x8 | ERCOT_H | ERCT-H | 6/24/2020 | 6/24/2020 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | WD | OFF | 12/01/2020 | Dec 2020 | Dec | 1 | 12 | |||||||||||||||||
15 | Physical | RealTimeMarket | Buy | 6/24/2020 | 11/1/2020 | 5/31/2021 | 7x16 | ERCOT_H | ERCT-H | 6/24/2020 | 6/24/2020 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 0.0 | 0.0 | WD | OFF | 12/01/2020 | Dec 2020 | Dec | 1 | 13 | |||||||||||||||||
16 | Physical | RealTimeMarket | Buy | 6/24/2020 | 11/1/2020 | 5/31/2021 | 7x8 | ERCOT_H | ERCT-H | 6/24/2020 | 6/24/2020 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | WD | OFF | 12/01/2020 | Dec 2020 | Dec | 1 | 14 | |||||||||||||||||
17 | Physical | RealTimeMarket | Buy | 6/24/2020 | 6/1/2021 | 6/30/2021 | 7x16 | ERCOT_H | ERCT-H | 6/24/2020 | 6/24/2020 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 0.0 | 0.0 | WD | OFF | 12/01/2020 | Dec 2020 | Dec | 1 | 15 | |||||||||||||||||
18 | Physical | RealTimeMarket | Buy | 6/24/2020 | 6/1/2021 | 6/30/2021 | 7x8 | ERCOT_H | ERCT-H | 6/24/2020 | 6/24/2020 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.5 | 0.5 | WD | OFF | 12/01/2020 | Dec 2020 | Dec | 1 | 16 | |||||||||||||||||
19 | Physical | RealTimeMarket | Buy | 6/24/2020 | 7/1/2021 | 7/31/2021 | 7x24 | ERCOT_H | ERCT-H | 6/24/2020 | 6/24/2020 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 | WD | OFF | 12/01/2020 | Dec 2020 | Dec | 1 | 17 | |||||||||||||||||
20 | Physical | RealTimeMarket | Buy | 6/24/2020 | 9/1/2020 | 9/30/2020 | 7x16 | ERCOT_N | ERCT-N | 6/24/2020 | 6/24/2020 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 3.0 | 3.0 | 3.0 | 3.0 | 3.0 | 3.0 | 3.0 | 3.0 | 3.0 | 3.0 | 3.0 | 3.0 | 3.0 | 3.0 | 3.0 | 3.0 | 0.0 | 0.0 | WD | OFF | 12/01/2020 | Dec 2020 | Dec | 1 | 18 | |||||||||||||||||
21 | Physical | RealTimeMarket | Buy | 6/24/2020 | 9/1/2020 | 9/30/2020 | 7x8 | ERCOT_N | ERCT-N | 6/24/2020 | 6/24/2020 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.5 | 1.5 | WD | OFF | 12/01/2020 | Dec 2020 | Dec | 1 | 19 | |||||||||||||||||
22 | Physical | RealTimeMarket | Buy | 6/24/2020 | 10/1/2020 | 1/31/2021 | 7x16 | ERCOT_N | ERCT-N | 6/24/2020 | 6/24/2020 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 0.0 | 0.0 | WD | OFF | 12/01/2020 | Dec 2020 | Dec | 1 | 20 | |||||||||||||||||
23 | Physical | RealTimeMarket | Buy | 6/24/2020 | 10/1/2020 | 1/31/2021 | 7x8 | ERCOT_N | ERCT-N | 6/24/2020 | 6/24/2020 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | WD | OFF | 12/01/2020 | Dec 2020 | Dec | 1 | 21 | |||||||||||||||||
24 | Physical | RealTimeMarket | Buy | 6/24/2020 | 2/1/2021 | 2/28/2021 | 5x16 | ERCOT_N | ERCT-N | 6/24/2020 | 6/24/2020 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 0.0 | 0.0 | WD | OFF | 12/01/2020 | Dec 2020 | Dec | 1 | 22 | |||||||||||||||||
25 | Physical | RealTimeMarket | Buy | 6/24/2020 | 2/1/2021 | 2/28/2021 | 7x8 | ERCOT_N | ERCT-N | 6/24/2020 | 6/24/2020 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | WD | OFF | 12/01/2020 | Dec 2020 | Dec | 1 | 23 | |||||||||||||||||
26 | Physical | RealTimeMarket | Buy | 6/24/2020 | 2/1/2021 | 2/28/2021 | 2x16 | ERCOT_N | ERCT-N | 6/24/2020 | 6/24/2020 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 0.0 | 0.0 | WD | OFF | 12/01/2020 | Dec 2020 | Dec | 1 | 24 | |||||||||||||||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
BA3 | BA3 | =SUM(INDEX(U3:AR98,MATCH(1,(J3:J98<=AV3)*(K3:K98>=AV3)*((L3:L98="7x24")+(L3:L98="7x8")+(L3:L98="2x8"))*(N3:N98="ERCT-N"),0),MATCH(AZ3,U2:AR2,0))) |