The following results in a #VALUE error, even when array-entered, which should not be necessary:
=SUMPRODUCT(C10:C13,VLOOKUP(B10:B13,A4:B6,2,0))
The intended interpretation is:
C10*VLOOKUP(B10,A4:B6,2,0) + C11*VLOOKUP(B11,A4:B6,2,0) + ....
The following work-around does not produce the correct result (array-entered):
=SUM(C10:C13*VLOOKUP(B10:B13,A4:B6,2,0))
It is misinterpreted as (array-entered):
=SUM(C10:C13*VLOOKUP(B10,A4:B6,2,0))
In other words, the VLOOKUP expression returns a single value instead of an array.
But the following does work as intended [1]:
=SUMPRODUCT(MATCH(B10:B13,A4:A6,0))
It is correctly interpreted as:
MATCH(B10,...) + MATCH(B11,...) + ....
My work-around is to calculate each VLOOKUP(B10,...), VLOOKUP(B11,...) etc in G10:G13 ("helper cells") and replace the original formula with:
=SUMPRODUCT(C10:C13,G10:G13)
Can someone offer a work-around that does not require helper cells?
-----
[1] PS, more to the point, the following works:
=SUMPRODUCT(C10:C13,MATCH(B10:B13,A4:A6,0))
It is correctly interpreted as:
C10*MATCH(B10,A4:A6,0)) + C11*MATCH(B11,A4:A6,0)) + ....
=SUMPRODUCT(C10:C13,VLOOKUP(B10:B13,A4:B6,2,0))
The intended interpretation is:
C10*VLOOKUP(B10,A4:B6,2,0) + C11*VLOOKUP(B11,A4:B6,2,0) + ....
The following work-around does not produce the correct result (array-entered):
=SUM(C10:C13*VLOOKUP(B10:B13,A4:B6,2,0))
It is misinterpreted as (array-entered):
=SUM(C10:C13*VLOOKUP(B10,A4:B6,2,0))
In other words, the VLOOKUP expression returns a single value instead of an array.
But the following does work as intended [1]:
=SUMPRODUCT(MATCH(B10:B13,A4:A6,0))
It is correctly interpreted as:
MATCH(B10,...) + MATCH(B11,...) + ....
My work-around is to calculate each VLOOKUP(B10,...), VLOOKUP(B11,...) etc in G10:G13 ("helper cells") and replace the original formula with:
=SUMPRODUCT(C10:C13,G10:G13)
Can someone offer a work-around that does not require helper cells?
-----
[1] PS, more to the point, the following works:
=SUMPRODUCT(C10:C13,MATCH(B10:B13,A4:A6,0))
It is correctly interpreted as:
C10*MATCH(B10,A4:A6,0)) + C11*MATCH(B11,A4:A6,0)) + ....
Last edited: