Hello,
Note: I just finished typing this whole post and realize it's hard to follow and I apologize in advance for that.
Is there a formula that can be used for this situation, or will I need to code it in VBA?
I have a workbook with several sheets, but only two are important for this. Let's call them Sheet1 and Sheet2.
Sheet1 has the following columns:
Name, Type, Data1, Data2
Sheet2 has the following columns:
Name, Type, AdjustedData1,<blank column>Name, Type, AdjustedData2
Sheet1 is sorted by Type first, then by Data1+Data2
Sheet2 has two sorts. On the left, it's sorted by AdjustedData1 and on the right by AdjustedData2.
What I want to do is take the Name from Sheet2 in the order that it appears, then find that name in Sheet1 and get the Data1 from Sheet1. I then want to add all of these Data1 values together and place them in another cell elsewhere.
I understand it's a bit tough to understand. It's hard to explain.
Sheet1:
Name Type Data1 Data2 John A 30 30 Bob A 15 20 Adam B 40 25 George B 10 50 Jack B 5 15
Types A are adjusted by 10 and 5 for Data1 and Data2 respectively, and types B are only adjusted by 5 for Data2. Only the 3 highest of each Data are kept:
Sheet2:
Name Type AdjData1 Name Type AdjData2 John A 40 George B 55 Adam B 40 John A 35 Bob A 25 Adam B 30
What I want to do is simply match all of the Names on Sheet2 and get the corresponding data from Sheet1. In this example, I would want to match John, Adam, and Bob from the AdjData1 column and sum their unadjusted Data1 values (85) and place them in a cell somewhere. Then do the same for George, John, and Adam on the AdjData2 side.
Is it in any way possible to do this with a formula or will I need to write new code into the already existing VBA? I'm still learning all of what can be done with formulas but I'm fairly competent at VBA.
Bookmarks