The data representation which is adapted here is flawed...
[TABLE="class: grid"]
<tbody>[TR]
[TD]Row\Col[/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[TD]F
[/TD]
[TD]G
[/TD]
[TD]H
[/TD]
[TD]I
[/TD]
[TD]J
[/TD]
[TD]K
[/TD]
[TD]L
[/TD]
[TD]M
[/TD]
[TD]N
[/TD]
[TD]O
[/TD]
[TD]P
[/TD]
[TD]Q
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD][/TD]
[TD]Location 1
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Location 2
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Location 1
[/TD]
[TD][/TD]
[TD][/TD]
[TD]Location 2
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD][/TD]
[TD]Volume
[/TD]
[TD]Other
[/TD]
[TD]Other
[/TD]
[TD]Other
[/TD]
[TD]Other
[/TD]
[TD]Volume
[/TD]
[TD]Other
[/TD]
[TD]Other
[/TD]
[TD]Other
[/TD]
[TD]Other
[/TD]
[TD]Other
[/TD]
[TD]Other
[/TD]
[TD]Price
[/TD]
[TD]Other
[/TD]
[TD]Other
[/TD]
[TD]Price
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]Product
[/TD]
[TD]100
[/TD]
[TD]42
[/TD]
[TD]42
[/TD]
[TD]42
[/TD]
[TD]42
[/TD]
[TD]200
[/TD]
[TD]42
[/TD]
[TD]42
[/TD]
[TD]42
[/TD]
[TD]42
[/TD]
[TD]42
[/TD]
[TD]42
[/TD]
[TD]$ 1.00
[/TD]
[TD]42
[/TD]
[TD]42
[/TD]
[TD]$ 2.00
[/TD]
[/TR]
</tbody>[/TABLE]
where you seem to want to associate:
Volume of 100 with Price of 1 and Volume of 200 with Price of 2
Imputing some logic into the foregoing something like: First volume occurrence X First price occurrence, what is the correlation when we have the following?
[TABLE="class: grid"]
<tbody>[TR]
[TD]Row\Col[/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[TD]F
[/TD]
[TD]G
[/TD]
[TD]H
[/TD]
[TD]I
[/TD]
[TD]J
[/TD]
[TD]K
[/TD]
[TD]L
[/TD]
[TD]M
[/TD]
[TD]N
[/TD]
[TD]O
[/TD]
[TD]P
[/TD]
[TD]Q
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD][/TD]
[TD]Location 1
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Location 2
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Location 1
[/TD]
[TD][/TD]
[TD][/TD]
[TD]Location 2
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD][/TD]
[TD]Volume
[/TD]
[TD]VOLUME
[/TD]
[TD]Other
[/TD]
[TD]Other
[/TD]
[TD]Other
[/TD]
[TD]Volume
[/TD]
[TD]Other
[/TD]
[TD]Other
[/TD]
[TD]Other
[/TD]
[TD]Other
[/TD]
[TD]Other
[/TD]
[TD]Other
[/TD]
[TD]Price
[/TD]
[TD]Other
[/TD]
[TD]Other
[/TD]
[TD]Price
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]Product
[/TD]
[TD]100
[/TD]
[TD]42
[/TD]
[TD]42
[/TD]
[TD]42
[/TD]
[TD]42
[/TD]
[TD]200
[/TD]
[TD]42
[/TD]
[TD]42
[/TD]
[TD]42
[/TD]
[TD]42
[/TD]
[TD]42
[/TD]
[TD]42
[/TD]
[TD]$ 1.00
[/TD]
[TD]42
[/TD]
[TD]42
[/TD]
[TD]$ 2.00
[/TD]
[/TR]
</tbody>[/TABLE]
I don't understand your question. This is what the current sample data looks like:
[TABLE="class: grid, width: 1000, align: left"]
<tbody>[TR]
[TD="align: center"][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"]H[/TD]
[TD="align: center"]I[/TD]
[TD="align: center"]J[/TD]
[TD="align: center"]K[/TD]
[TD="align: center"]L[/TD]
[TD="align: center"]M[/TD]
[TD="align: center"]N[/TD]
[TD="align: center"]O[/TD]
[TD="align: center"]P[/TD]
[TD="align: center"]Q[/TD]
[TD="align: center"]R[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"][/TD]
[TD="align: center"]
LOCATION 1[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]
LOCATION 2[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]
LOCATION 1[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]
LOCATION 2[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"][/TD]
[TD="align: center"]
Volume[/TD]
[TD="align: center"]
Other[/TD]
[TD="align: center"]
Other[/TD]
[TD="align: center"]
Other[/TD]
[TD="align: center"]
Other[/TD]
[TD="align: center"]
Volume[/TD]
[TD="align: center"]
Other[/TD]
[TD="align: center"]
Other[/TD]
[TD="align: center"]
Other[/TD]
[TD="align: center"]
Other[/TD]
[TD="align: center"]
Other[/TD]
[TD="align: center"]
Other[/TD]
[TD="align: center"]
Price[/TD]
[TD="align: center"]
Other[/TD]
[TD="align: center"]
Other[/TD]
[TD="align: center"]
Price[/TD]
[TD="align: center"]
Total Spent[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD="align: center"]
Product[/TD]
[TD="align: center"]200[/TD]
[TD="align: center"]42[/TD]
[TD="align: center"]42[/TD]
[TD="align: center"]42[/TD]
[TD="align: center"]42[/TD]
[TD="align: center"]50[/TD]
[TD="align: center"]42[/TD]
[TD="align: center"]42[/TD]
[TD="align: center"]42[/TD]
[TD="align: center"]42[/TD]
[TD="align: center"]42[/TD]
[TD="align: center"]42[/TD]
[TD="align: center"]$1.00[/TD]
[TD="align: center"]42[/TD]
[TD="align: center"]42[/TD]
[TD="align: center"]$2.00[/TD]
[TD="align: center"]Formula[/TD]
[/TR]
</tbody>[/TABLE]
The "Total Spent" should be the sumproduct of the following Arrays
B3 (200) X N3 ($1.00)
G3 (050) X Q3 ($2.00)
The value returned should be $300.00
If I use the following formula is get an error as it returns the following arrays with "False" values
{=SUMPRODUCT(IF(B3:K3="Volume",B4:K4),IF(L3:Q3="Price", L4:Q4))}
B3 (200) X___FALSE
_FALSE__X___FALSE
_FALSE__X_N3 ($1.00)
_FALSE__X___FALSE
_FALSE__X___FALSE
G3 (050) X Q3 ($2.00)
_FALSE__
_FALSE__
_FALSE__
_FALSE__
If I use the following formula is get an error as it reorders the arrays from lowest to highest value the following arrays
{=SUMPRODUCT(SMALL(IF(B3:K3="Volume",B4:K4,""),ROW(INDIRECT("1:"&COUNTIF(B3:K3,"Volume")))),SMALL(IF(L3:Q3="Price", L4:Q4,""),ROW(INDIRECT("1:"&COUNTIF(L3:Q3,"Price")))))}
G3 (050) X N3 ($1.00)
B3 (200) X Q3 ($2.00)
This returns $450.00
The following works but requires addition iterations for each added location to the ranges. I need to develop a formula that can handle dynamic ranges so as columns are added for more locations it automatically adjusts.
{=SUM(INDEX(A4:Q4,1,LARGE((A3:Q3="Volume")*COLUMN(A3:Q3),1))*INDEX(A4:Q4,1,LARGE((A3:Q3="Price")*COLUMN(A3:Q3),1)),INDEX(A4:Q4,1,LARGE((A3:Q3="Volume")*COLUMN(A3:Q3),2))*INDEX(A4:Q4,1,LARGE((A3:Q3="Price")*COLUMN(A3:Q3),2)))}
I hope that clears up any confusion as to what I am looking to accomplish. Thanks.