INDEX MATCH BETWEEN TIMES?

RedOctoberKnight

Board Regular
Joined
Nov 16, 2015
Messages
150
Office Version
  1. 2016
Platform
  1. Windows
Good Morning,

I'm looking to find out if its possible to use index and match using multiple criteria including time. One of the criteria would be whether or not the current time falls between two times and the other would be a door number. Trying to find out the truck that falls between the two times and specified door number. Below is a rough example.

Book2
ABCDEF
1STARTENDDOORTRUCK
211:0012:101ADoor2
311:1511:552BTIME11:30
411:0011:453CTruck
512:2513:004D
613:3014:055B
713:3014:203C
814:0015:001
914:2015:302
1014:5515:403
1116:0517:051
1216:4017:202
1317:0517:503
1417:2018:151
1517:2518:052
1618:4519:303
Sheet1


I would also like the time to be based off the current time if possible

Any help would be much appreciated. Thanks!
 
Last edited:

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
How about
+Fluff New.xlsm
ABCDEF
1STARTENDDOORTRUCK
211:0012:101ADoor2
311:1511:552BTIME11:30
411:0011:453CTruckB
512:2513:004D
613:3014:055B
713:3014:203C
814:0015:001
914:2015:302
1014:5515:403
1116:0517:051
1216:4017:202
1317:0517:503
1417:2018:151
1517:2518:052
1618:4519:303
Results
Cell Formulas
RangeFormula
F4F4=INDEX(D2:D16,AGGREGATE(15,6,(ROW(D2:D16)-ROW(D2)+1)/(C2:C16=F2)/(MOD(A2:A16,1)<=F3)/(MOD(B2:B16,1)>=F3),1))
 
Upvote 0
Thanks Fluff. I modified the formula to fit my worksheet. I'm having issues with using the now( ) time. if I put the now( ) time in F2 and I change the times in the columns to where the now( ) time falls between them, I get a #num error. I'm assuming it has to do with now( ) time formatting. Is there any way to fix that?
 
Upvote 0
Now returns date & time, whereas your data showed F3 just had time, try
Excel Formula:
=INDEX(D2:D16,AGGREGATE(15,6,(ROW(D2:D16)-ROW(D2)+1)/(C2:C16=F2)/(MOD(A2:A16,1)<=MOD(F3,1))/(MOD(B2:B16,1)>=MOD(F3,1)),1))
 
Upvote 0
Thanks Fluff! Works perfectly. I'm sure I'll have more questions to come. Appreciate the help!
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0
Glad to help & thanks for the feedback.
Hi Fluff,

I have a similar issue, want to do the same thing, but looking up a full column, if that doesn´t matter the only difference is that I have to look at time with the date: "2022-07-20 16:18". When I use your formula above, it seems to return an off value, maybe 100 rows below. Also the indexed value is not liked to the row criteria I put in?

Can you help me, please?
 
Upvote 0
Hi & welcome to MrExcel.
Please start a thread of your own for this question & explain exactly what you are trying do. Also posting some data will help potential helpers.
 
Upvote 0

Forum statistics

Threads
1,214,926
Messages
6,122,306
Members
449,079
Latest member
juggernaut24

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