View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JP Ronse JP Ronse is offline
external usenet poster
 
Posts: 174
Default Using VLOOKUP inside SUMPRODUCT = complex problem

Hi,

Try

=SUMIF(A1:A3;"a";B1:B3)*SUMIF(C1:C2;"a";D1)+SUMIF( A1:A3;"b";B1:B3)*SUMIF(C1:C2;"b";D1)

Please note that you may have to change ";" in ",".

Wkr,

JP


"vsoler" wrote in message
...
I have an excel model quite complex with the followinf layout
(drastically simplified):

col A col B col C col D
row 1: a 3 a 0.5
row 2 b 4 b 1
row 3: a 5

I need to calculate, by means of a sumproduct function, the
calculation:

(3*0.5 + 4*1 + 5*0.5) = 1.5 + 4 + 2.5 = 8

I have tried =SUMPRODUCT(B1:B3,VLOOKUP(A1:A3,C1:D2,2,0)) but it does
not work.
I have also tried the above formula using Ctrl-Shift-Enter, with the
same result.

Because my model is really complex, I do not want to use auxiliary
columns for intermediate results.

Is it possible to use SUMPRODUCT the way I need?