Question : How to combine VLOOKUP with SUMPRODUCT/SUMIF?

Dear experts...

I am trying to sum a column based on information in other columns with Excel 2003. The structure of the data is as follows:

Sheet 1 (Table1) - data from manufacturer:
partnumber - cost - yearly cost - service cost

Sheet 2 (Table 2) - producer's orders:
ordernumber - partnumber

Sheet 3 (Table 3) - review of orders:
ordernumber - total cost - total yearly cost - total service cost


The second sheet might contain shuffled orders, meaning that an ordernumber might occur several times during the list with orders for different parts.

In order to make a correct sum I tried using SUMIF and SUMPRODUCT combined with VLOOKUP, but neither got me all the way. Therefore I am turning to you experts in hope for advice.

Looking forward to your replies.

Answer : How to combine VLOOKUP with SUMPRODUCT/SUMIF?

You can use SUMIF within SUMPRODUCT

If all the tables you describe start at A1 in the relevant sheets, with headers in row 1 and data from row 2 to row 100 then you can use this formula in sheet3 B2 copied across and down

=SUMPRODUCT(--(sheet2!$A$2:$A$100=$A2),SUMIF(sheet1!$A$2:$A$100,sheet2!$B$2:$B$100,sheet1!B$2:B$100))

Random Solutions  
 
programming4us programming4us