0

I am confused as to how to create a macro for the following process :

There are two workbooks.. one with part numbers (wb1) and the other with part numbers and prices for those numbers (wb2); I need to do the following :

  • Find the corresponding part number of wb2 in wb1 and input the price accompanying the part number in wb2 in column k of wb1... however, wb2 has duplicate part numbers and therefore some parts have more than one price.. I need the highest price inputted in column k of wb1 for the correct part number. Additionally, wb1 may have duplicates, but I want the highest price value from wb2 for the correct part number to be inputted in all duplicates of the part number in wb1 Here is a visual : VISUAL

Hopefully this made sense, let me know how I can accomplish this!

4

1 回答 1

2

假设这样的设置:

在此处输入图像描述

您可以使用这样的公式:

=MAX(IF([Book1]Sheet1!$A$2:$A$8=A2,[Book1]Sheet1!$B$2:$B$8,""))

请注意,它是一个数组公式,所以需要用 输入Ctrl ShiftEnter

于 2013-07-29T20:15:04.440 回答