Comparing 2 Tables and Pulling Row from 1 Into the Other If it Takes Place within 20 Minutes AFTER the original date/time stamp

L

Legacy 367570

Guest
Hi All,

Bit of a complicated one. Any help much appreciated!!!

So I have two sets of data I want to link together.


Both have time stamps in format mm/dd/yyyy hh:mm in each row.


I for each row in table 1, I want to look at the time stamp, then return the details of the row in table 2 that occurs within 20 minutes AFTER the date and time stamp in table 1. The formula should ONLY return the row with the highest value based on another column


So

Table 1


NameTimeOutput Data 1Output Data 2Output Data 3
John02/02/2016 08:45:00
?

<tbody>
</tbody>
??
Luke

<tbody>
</tbody>
02/08/2016 06:00

<tbody>
</tbody>
???
Sarah

<tbody>
</tbody>
02/15/2016 12:52

<tbody>
</tbody>
???
Ben

<tbody>
</tbody>
02/20/2016 21:45

<tbody>
</tbody>
???

<tbody>
</tbody>

Table 2


Product

<tbody>
</tbody>
Time

<tbody>
</tbody>
Value

<tbody>
</tbody>
Additional Value 1

<tbody>
</tbody>
Additional Value 2

<tbody>
</tbody>
Additional Value 3

<tbody>
</tbody>
Apple

<tbody>
</tbody>
02/15/2016 08:55

<tbody>
</tbody>
5.665

<tbody>
</tbody>
a6r
Orange

<tbody>
</tbody>
02/20/2016 06:08

<tbody>
</tbody>
3.874

<tbody>
</tbody>
5wx
Pear

<tbody>
</tbody>
02/02/2016 12:58

<tbody>
</tbody>
9.254

<tbody>
</tbody>
753
Water

<tbody>
</tbody>
02/08/2016 22:02

<tbody>
</tbody>
2.987

<tbody>
</tbody>
1!=
Soda

<tbody>
</tbody>
02/08/2016 21:56

<tbody>
</tbody>
1.157

<tbody>
</tbody>
dwd
Coke

<tbody>
</tbody>
02/20/2016 06:18

<tbody>
</tbody>

3.997

<tbody>
</tbody>
123

<tbody>
</tbody>



Output

Name

<tbody>
</tbody>
TimeProductTimeValue
Additional Value 1

<tbody>
</tbody>
Additional Value 2

<tbody>
</tbody>
Additional Value 3

<tbody>
</tbody>
John
02/02/2016 08:45

<tbody>
</tbody>
Apple

<tbody>
</tbody>
02/15/2016 08:55

<tbody>
</tbody>
5.665

<tbody>
</tbody>
a6r
Luke
02/08/2016 06:00

<tbody>
</tbody>
Coke

<tbody>
</tbody>
02/20/2016 06:18

<tbody>
</tbody>
3.997

<tbody>
</tbody>
123
Sarah
02/15/2016 12:52

<tbody>
</tbody>
Pear

<tbody>
</tbody>
02/02/2016 12:58

<tbody>
</tbody>
9.254

<tbody>
</tbody>
753
Ben
02/20/2016 21:45

<tbody>
</tbody>
Water

<tbody>
</tbody>
02/08/2016 22:02

<tbody>
</tbody>
2.987

<tbody>
</tbody>
1!=

<tbody>
</tbody>


As you can see above, each of the returned rows are within 20 minutes after the original, and for Ben and Luke, return the rows with the highest value.


Any ideas on how I can achieve this?


Thanks in advance!
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Forum statistics

Threads
1,216,949
Messages
6,133,672
Members
449,823
Latest member
jsharpe

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top