Find date/time that is between dates/times in another dataset

MagiCarty

New Member
Joined
Oct 4, 2013
Messages
12
So I have two sets of data that I need to match up.

Set 1:
Column A has "Vehicles" like 29, 21, 20, etc. Column B has "Date/time" of when that vehicle last sent data.

Set 2:
Column D has the "Arrival Date/Time" of when the vehicle entered a location. Column E has the "Departure Date/Time" of when the vehicle left the location. Column F is the "Location" where the vehicle was between the Arrival and Departure times. Column G has the "Vehicle" assignment again (29, 21, 20, etc).

I'm looking for a formula to tell me which Location the vehicle was at by using the date/time in column B to be between the date/times in columns D and E, AND to match the vehicle numbers.

I can provide actual data if this will help. I wish there was an easy way to embed actual excel data into these things. Many thanks for your helps.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
So I have two sets of data that I need to match up.

Set 1:
Column A has "Vehicles" like 29, 21, 20, etc. Column B has "Date/time" of when that vehicle last sent data.

Set 2:
Column D has the "Arrival Date/Time" of when the vehicle entered a location. Column E has the "Departure Date/Time" of when the vehicle left the location. Column F is the "Location" where the vehicle was between the Arrival and Departure times. Column G has the "Vehicle" assignment again (29, 21, 20, etc).

I'm looking for a formula to tell me which Location the vehicle was at by using the date/time in column B to be between the date/times in columns D and E, AND to match the vehicle numbers.

I can provide actual data if this will help. I wish there was an easy way to embed actual excel data into these things. Many thanks for your helps.
Hi,

Given in A1:

<style>table { }td { padding-top: 1px; padding-right: 1px; padding-left: 1px; color: black; font-size: 12pt; font-weight: 400; font-style: normal; text-decoration: none; font-family: Calibri,sans-serif; vertical-align: bottom; border: medium none; white-space: nowrap; }.xl64 { text-align: center; }.xl65 { text-align: center; }.xl66 { text-align: center; }</style>
vehiclesDTlocation isA DTD DTlocationvehicle
291/1/13 6:10X1/1/13 6:001/1/13 6:30X29
301/1/13 7:00W1/1/13 7:201/1/13 7:40Y30
311/1/13 8:001/1/13 8:301/1/13 8:38Z31
1/1/13 6:501/1/13 7:05W30

<tbody>
</tbody>



Formula in C2 is =IFERROR(INDEX(Sheet3!$F$2:$F$5,MATCH(1,(B2 > Sheet3!$D$2:$D$5)*(B2 < Sheet3!$E$2:$E$5)*(A2=Sheet3!$G$2:$G$5),0)),"")
Ctrl + Shift + Enter not just Enter on a PC or Command + Return on a MAC.
<s heet3!$e$2:$e$5)*(a2="Sheet3!$G$2:$G$5),0)),"")

</s>
 
Last edited:
Upvote 0
My customer's data source is flawed, however this formula works perfectly. Thank you.

Glad it worked for you.
Thanks for the feedback and good luck for cleaning up the database!
 
Upvote 0

Forum statistics

Threads
1,221,418
Messages
6,159,790
Members
451,589
Latest member
Harold14

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