Hi everyone, I'm very new to VBA and look for help for a practical Excel example. I've got it work in Excel but it will be much easier if using a VBA function. Sample attached.
Column A: company name, column B: related weightings.
Column C: company name.
The expected results are shown in column G:
Names in column G are those that: exist in column A but do not exist in column C, and they are ranked based on the related weightings (shown in column B).
How can I get that output? Assume column F is the ID of rankings 1, 2, 3.... I can type the UDF in each cell of column G as:
In cell G2: =Function_Port(A1:A20,B1:B20,C1:C20,F2), this will give me the company which exists in column A, but does not exist in column C and has the largest weight;
In cell G3: =Function_Port(A1:A20,B1:B20,C1:C20,F3), this will give me the company which exists in column A, but does not exist in column C and has the 2nd largest weight;
...
The expected results are shown in column G of the sample file.
Bookmarks