DavidMWright
New Member
- Joined
- Jul 9, 2018
- Messages
- 5
Good day,
I am hoping somebody can help me.
I have 2 tabs, as shown below. I am trying to copy column C (Name) from tab2 to column C (Name) on tab1 where columns A (ID) match.
Now the above I can do using a vlookup but where I am failing is that it needs to copy the value from the row where column B (Date) on tab2 is the nearest date (same date or in future) of column B (Date) on tab1.
Tab1
[TABLE="width: 500"]
<tbody>[TR]
[TD][TABLE="width: 198"]
<tbody>[TR]
[TD="class: xl65"]ID[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]Date[/TD]
[TD]Name[/TD]
[/TR]
[TR]
[TD][TABLE="width: 198"]
<tbody>[TR]
[TD]001A000000GISbdIAH[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 157"]
<tbody>[TR]
[TD="class: xl65"]01/01/2017[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]001A000000GISTtIAP[/TD]
[TD][TABLE="width: 157"]
<tbody>[TR]
[TD="class: xl65"]01/01/2017[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][TABLE="width: 198"]
<tbody>[TR]
[TD]001G000000f4KfyIAE[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 157"]
<tbody>[TR]
[TD="class: xl65"]01/01/2017[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][TABLE="width: 198"]
<tbody>[TR]
[TD]001A000000GISVSIA5[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 157"]
<tbody>[TR]
[TD="class: xl65"]02/01/2017[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][TABLE="width: 198"]
<tbody>[TR]
[TD]001G000000oOGP4IAO[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 157"]
<tbody>[TR]
[TD="class: xl65"]24/01/2017[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Tab2
[TABLE="width: 500"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Date[/TD]
[TD]Name[/TD]
[/TR]
[TR]
[TD][TABLE="width: 176"]
<tbody>[TR]
[TD]0011600001mEulTAAS[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 176"]
<tbody>[TR]
[TD="class: xl65"]13/07/2015[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]Adam[/TD]
[/TR]
[TR]
[TD][TABLE="width: 176"]
<tbody>[TR]
[TD]0011600001mEulTAAS[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 176"]
<tbody>[TR]
[TD="class: xl65"]16/02/2016[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]John[/TD]
[/TR]
[TR]
[TD][TABLE="width: 176"]
<tbody>[TR]
[TD]0011600001mEulTAAS[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 176"]
<tbody>[TR]
[TD="class: xl65"]26/01/2018[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]Dave[/TD]
[/TR]
[TR]
[TD][TABLE="width: 176"]
<tbody>[TR]
[TD]0011600001mEulTAAS[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 176"]
<tbody>[TR]
[TD="class: xl65"]29/06/2018[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]Steve[/TD]
[/TR]
[TR]
[TD][TABLE="width: 176"]
<tbody>[TR]
[TD]0011600001nRtIxAAK[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 176"]
<tbody>[TR]
[TD="class: xl65"]20/10/2017[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]Michael[/TD]
[/TR]
</tbody>[/TABLE]
Hope that makes sense.
Greatly appreciate any help.
Dave
I am hoping somebody can help me.
I have 2 tabs, as shown below. I am trying to copy column C (Name) from tab2 to column C (Name) on tab1 where columns A (ID) match.
Now the above I can do using a vlookup but where I am failing is that it needs to copy the value from the row where column B (Date) on tab2 is the nearest date (same date or in future) of column B (Date) on tab1.
Tab1
[TABLE="width: 500"]
<tbody>[TR]
[TD][TABLE="width: 198"]
<tbody>[TR]
[TD="class: xl65"]ID[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]Date[/TD]
[TD]Name[/TD]
[/TR]
[TR]
[TD][TABLE="width: 198"]
<tbody>[TR]
[TD]001A000000GISbdIAH[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 157"]
<tbody>[TR]
[TD="class: xl65"]01/01/2017[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]001A000000GISTtIAP[/TD]
[TD][TABLE="width: 157"]
<tbody>[TR]
[TD="class: xl65"]01/01/2017[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][TABLE="width: 198"]
<tbody>[TR]
[TD]001G000000f4KfyIAE[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 157"]
<tbody>[TR]
[TD="class: xl65"]01/01/2017[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][TABLE="width: 198"]
<tbody>[TR]
[TD]001A000000GISVSIA5[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 157"]
<tbody>[TR]
[TD="class: xl65"]02/01/2017[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][TABLE="width: 198"]
<tbody>[TR]
[TD]001G000000oOGP4IAO[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 157"]
<tbody>[TR]
[TD="class: xl65"]24/01/2017[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Tab2
[TABLE="width: 500"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Date[/TD]
[TD]Name[/TD]
[/TR]
[TR]
[TD][TABLE="width: 176"]
<tbody>[TR]
[TD]0011600001mEulTAAS[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 176"]
<tbody>[TR]
[TD="class: xl65"]13/07/2015[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]Adam[/TD]
[/TR]
[TR]
[TD][TABLE="width: 176"]
<tbody>[TR]
[TD]0011600001mEulTAAS[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 176"]
<tbody>[TR]
[TD="class: xl65"]16/02/2016[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]John[/TD]
[/TR]
[TR]
[TD][TABLE="width: 176"]
<tbody>[TR]
[TD]0011600001mEulTAAS[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 176"]
<tbody>[TR]
[TD="class: xl65"]26/01/2018[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]Dave[/TD]
[/TR]
[TR]
[TD][TABLE="width: 176"]
<tbody>[TR]
[TD]0011600001mEulTAAS[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 176"]
<tbody>[TR]
[TD="class: xl65"]29/06/2018[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]Steve[/TD]
[/TR]
[TR]
[TD][TABLE="width: 176"]
<tbody>[TR]
[TD]0011600001nRtIxAAK[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 176"]
<tbody>[TR]
[TD="class: xl65"]20/10/2017[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]Michael[/TD]
[/TR]
</tbody>[/TABLE]
Hope that makes sense.
Greatly appreciate any help.
Dave