Tacos_Tacos_Tacos
New Member
- Joined
- Mar 17, 2015
- Messages
- 13
Hello. This one's a doozy. I've had little luck finding answers elsewhere, so perhaps someone here can help.
I have two sheets - Sheet1 and Sheet2. On Sheet1, I have four columns: NAME, CHECK DATE, ELECTION TYPE, and ELECTION AMT. The first two columns are populated, and the latter two are not. The first column will contain names three rows (not merged) at a time. For example, "John Smith" will appear three times in three rows, each with a different date in the DATE column. Our goal is to populate the ELECTION TYPE and ELECTION AMT columns by referencing the data from the first two to find the appropriate data on Sheet2.
Sheet1:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Check Date[/TD]
[TD]Election Type[/TD]
[TD]Election Amt.[/TD]
[/TR]
[TR]
[TD]Phil[/TD]
[TD]10/31/14[/TD]
[TD]?[/TD]
[TD]?[/TD]
[/TR]
[TR]
[TD]Phil[/TD]
[TD]11/14/14[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Phil[/TD]
[TD]11/28/14[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Elizabeth[/TD]
[TD]10/31/14[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Elizabeth[/TD]
[TD]11/14/14[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Elizabeth[/TD]
[TD]11/28/14[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
On Sheet2 I have four columns: NAME, ELECTION TYPE, ELECTION AMT, and EFFECTIVE DATE. Each name may appear any number of times, with varying data under ELECTION TYPE and ELECTION AMT. This is the data we want to pull to Sheet1.
Sheet2:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Election Type[/TD]
[TD]Election Amount[/TD]
[TD]Effective Date[/TD]
[/TR]
[TR]
[TD]Phil[/TD]
[TD]Pre-tax[/TD]
[TD]14%[/TD]
[TD]9/13/14[/TD]
[/TR]
[TR]
[TD]Phil[/TD]
[TD]Pre-tax[/TD]
[TD]17%[/TD]
[TD]9/14/14[/TD]
[/TR]
[TR]
[TD]Phil[/TD]
[TD]Roth[/TD]
[TD]20%[/TD]
[TD]10/28/14[/TD]
[/TR]
[TR]
[TD]Phil
[/TD]
[TD]Roth[/TD]
[TD]15%[/TD]
[TD]11/7/14[/TD]
[/TR]
[TR]
[TD]Phil[/TD]
[TD]Pre-tax[/TD]
[TD]10%[/TD]
[TD]11/10/14[/TD]
[/TR]
[TR]
[TD]Phil[/TD]
[TD]Roth[/TD]
[TD]14%[/TD]
[TD]11/21/14[/TD]
[/TR]
[TR]
[TD]Phil[/TD]
[TD]Pre-tax[/TD]
[TD]12%[/TD]
[TD]11/28/14[/TD]
[/TR]
[TR]
[TD]Elizabeth[/TD]
[TD]Roth[/TD]
[TD]9%[/TD]
[TD]10/16/14[/TD]
[/TR]
[TR]
[TD]Elizabeth[/TD]
[TD]Roth[/TD]
[TD]14%[/TD]
[TD]10/31/14[/TD]
[/TR]
[TR]
[TD]Elizabeth[/TD]
[TD]Pre-tax[/TD]
[TD]10%[/TD]
[TD]11/1/14[/TD]
[/TR]
[TR]
[TD]Elizabeth[/TD]
[TD]Pre-tax[/TD]
[TD]15%[/TD]
[TD]11/2/14[/TD]
[/TR]
[TR]
[TD]Elizabeth[/TD]
[TD]Pre-tax[/TD]
[TD]5%[/TD]
[TD]11/26/14[/TD]
[/TR]
[TR]
[TD]Elizabeth[/TD]
[TD]Pre-tax[/TD]
[TD]8%[/TD]
[TD]12/15/14[/TD]
[/TR]
</tbody>[/TABLE]
I need to develop a formula for use in Sheet1 that will allow me to look up the corresponding name on Sheet2, then, referencing CHECK DATE on Sheet1, find the EFFECTIVE DATE on Sheet2 that is closest without going over. So, for example, if we are referencing the first row on Sheet1, we would look on Sheet2 for the rows that have "Phil" in the first column, and then the date closest to 10/31/14 that does not exceed that date. Here, it would be "10/28/14." Finally, I want to populate the latter two columns of Sheet1 with the corresponding data from the appropriate row on Sheet2 ("Roth" and "20%" in this example).
I suspect this will require an array function, and I am not as experienced with that as I'd like. We're dealing with about 100,000 rows here, so any help or insight would be immensely appreciated. I've shopped this around other forums, but have found no good solution yet. Thank you in advance for your time and effort.
I have two sheets - Sheet1 and Sheet2. On Sheet1, I have four columns: NAME, CHECK DATE, ELECTION TYPE, and ELECTION AMT. The first two columns are populated, and the latter two are not. The first column will contain names three rows (not merged) at a time. For example, "John Smith" will appear three times in three rows, each with a different date in the DATE column. Our goal is to populate the ELECTION TYPE and ELECTION AMT columns by referencing the data from the first two to find the appropriate data on Sheet2.
Sheet1:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Check Date[/TD]
[TD]Election Type[/TD]
[TD]Election Amt.[/TD]
[/TR]
[TR]
[TD]Phil[/TD]
[TD]10/31/14[/TD]
[TD]?[/TD]
[TD]?[/TD]
[/TR]
[TR]
[TD]Phil[/TD]
[TD]11/14/14[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Phil[/TD]
[TD]11/28/14[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Elizabeth[/TD]
[TD]10/31/14[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Elizabeth[/TD]
[TD]11/14/14[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Elizabeth[/TD]
[TD]11/28/14[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
On Sheet2 I have four columns: NAME, ELECTION TYPE, ELECTION AMT, and EFFECTIVE DATE. Each name may appear any number of times, with varying data under ELECTION TYPE and ELECTION AMT. This is the data we want to pull to Sheet1.
Sheet2:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Election Type[/TD]
[TD]Election Amount[/TD]
[TD]Effective Date[/TD]
[/TR]
[TR]
[TD]Phil[/TD]
[TD]Pre-tax[/TD]
[TD]14%[/TD]
[TD]9/13/14[/TD]
[/TR]
[TR]
[TD]Phil[/TD]
[TD]Pre-tax[/TD]
[TD]17%[/TD]
[TD]9/14/14[/TD]
[/TR]
[TR]
[TD]Phil[/TD]
[TD]Roth[/TD]
[TD]20%[/TD]
[TD]10/28/14[/TD]
[/TR]
[TR]
[TD]Phil
[/TD]
[TD]Roth[/TD]
[TD]15%[/TD]
[TD]11/7/14[/TD]
[/TR]
[TR]
[TD]Phil[/TD]
[TD]Pre-tax[/TD]
[TD]10%[/TD]
[TD]11/10/14[/TD]
[/TR]
[TR]
[TD]Phil[/TD]
[TD]Roth[/TD]
[TD]14%[/TD]
[TD]11/21/14[/TD]
[/TR]
[TR]
[TD]Phil[/TD]
[TD]Pre-tax[/TD]
[TD]12%[/TD]
[TD]11/28/14[/TD]
[/TR]
[TR]
[TD]Elizabeth[/TD]
[TD]Roth[/TD]
[TD]9%[/TD]
[TD]10/16/14[/TD]
[/TR]
[TR]
[TD]Elizabeth[/TD]
[TD]Roth[/TD]
[TD]14%[/TD]
[TD]10/31/14[/TD]
[/TR]
[TR]
[TD]Elizabeth[/TD]
[TD]Pre-tax[/TD]
[TD]10%[/TD]
[TD]11/1/14[/TD]
[/TR]
[TR]
[TD]Elizabeth[/TD]
[TD]Pre-tax[/TD]
[TD]15%[/TD]
[TD]11/2/14[/TD]
[/TR]
[TR]
[TD]Elizabeth[/TD]
[TD]Pre-tax[/TD]
[TD]5%[/TD]
[TD]11/26/14[/TD]
[/TR]
[TR]
[TD]Elizabeth[/TD]
[TD]Pre-tax[/TD]
[TD]8%[/TD]
[TD]12/15/14[/TD]
[/TR]
</tbody>[/TABLE]
I need to develop a formula for use in Sheet1 that will allow me to look up the corresponding name on Sheet2, then, referencing CHECK DATE on Sheet1, find the EFFECTIVE DATE on Sheet2 that is closest without going over. So, for example, if we are referencing the first row on Sheet1, we would look on Sheet2 for the rows that have "Phil" in the first column, and then the date closest to 10/31/14 that does not exceed that date. Here, it would be "10/28/14." Finally, I want to populate the latter two columns of Sheet1 with the corresponding data from the appropriate row on Sheet2 ("Roth" and "20%" in this example).
I suspect this will require an array function, and I am not as experienced with that as I'd like. We're dealing with about 100,000 rows here, so any help or insight would be immensely appreciated. I've shopped this around other forums, but have found no good solution yet. Thank you in advance for your time and effort.