Piemol
Piemol

Reputation: 55

Excel: How to find a certain row and multiply the values in that row by a certain number?

I'm trying to find a specific row by checking its unique code and multiply all the values in that row by its weight. Please see the example below.

 A      B       C       D       E          F       G
 code   weight  code    price   quantity   new_p   new_q  
 A11    0.1     A11     10      5          1       0.5
 A12    0.2     A12     4       3          0.8     0.6
 A11    0.3     A13     2       9          3       1.5
 A14    0.2     A14     4       16         0.8     3.2
 A12    0.4                                1.6     1.2
 A11    0.8                                8       4  

In the above example, my goal is to get the values in column F and G. You can see A-B and C-E as two separate spreadsheet: Basically, for each row in A, I look for its corresponding original price and quantity from D and E and then multiply the values in D & E by its unique weight from B, which will result in a new price and a new quantity.

I have been using sumproduct, but is there any smarter way of doing this?

Upvotes: 0

Views: 121

Answers (1)

Scott Craner
Scott Craner

Reputation: 152465

Put this in F2 and copy over one and down the data set:

=$B2*VLOOKUP($A2,$C:$E,COLUMN(B1),FALSE)

enter image description here

Upvotes: 2

Related Questions